Message Boards Message Boards

0
|
3050 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Modification of formulas without changing expression number

Posted 3 years ago

I made a Original:

In[1]=a+b

In[2]=In[1]+3

.....

If In[1] is modified to "a+b+2", In[1] is changed to In[3]. So, I have to collect In[2] to In[3]+3. All subsequent formulas have to be modified in the same way. Is there any way to change only the content of the expression without changing the expression number?

POSTED BY: h r
2 Replies

Please check this note to know how to define your own function and change the parameter you need

https://reference.wolfram.com/language/tutorial/FunctionsAndPrograms.html

POSTED BY: Ahmed Elbanna

Hi h r,

I'm not sure what you mean by "expression number".

Are you trying to recursively define a function "In", so that

In[i] depends on In[i-1] ?

Or are you trying to define a List "In", so that

In[[i]] depends on In[[i-1]] ?

Note the syntax difference of single bracket "[" vs double bracket "[[". The latter refers to Part, and is defined here:

https://reference.wolfram.com/language/ref/Part.html

POSTED BY: Richard Frost
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract