MATLAB: How to run iterations

iteration

Please I need help with iterations. For instance, if my Matlab script runs thus:
z=2; z=1+z
What can i do if i am looking to run this a hundred times such that the result from '1+z' is put in place of Z upon every iteration. Thanks

Best Answer

z=2;
for K = 1 : 100
z=1+z
end
Related Question