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?
ahmed
(Ahmed Elbanna)
December 30, 2020, 9:40pm
2
Please check this note to know how to define your own function and change the parameter you need
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:
expr[[i]] or Part[expr, i] gives the i\[Null]^th part of expr. expr[[-i]] counts from the end. expr[[i, j, ...]] or Part[expr, i, j, ...] is equivalent to expr[[i]][[j]] .... expr[[{i1, i2, ...}]] gives a list of the parts i1, i2, ... of expr....