i feel I can not do iteration x(h,i+1)=x(i)+h in Mathcad Prime
x(h,i+1)=x(i)+h (Error this point)
Solved! Go to Solution.
Seems that you try to create a vector and are assuming ORIGIN=1.
You are using x as a function with two arguments (h,i) in one place, but then as a function of only one argument in another.
Are you looking for something like the following. If you are just interested in the last value, you can simply delete the last line (x) but of course the last value could be calculated more simply and direct.
I prefer like this
x(h,i+1)=x(i)+h ( x is a function have h as a variable and i also have h as a variable)
You can't define a function which on one instance accepts two arguments (x(h,i+1)) but on the other only one (x(i)).
Its also not clear to me what result you actually expect.
Maybe you can specify what you would like to see for h=0.4, for example.
> And the answer I need x(i+1,h)
You defined i as a function which returns a complete range! There is no "i+1" or "i(h)+1". You can't add a range and a number!
Still unclear what you are looking for at the end.