For example my equation A(i) = (M.*V./(B+C.*A(i-1))).^a
I know that A(1)=0, I start from i=2, and my first approximation A(2) = (M.*V./(B+C.*A(1))).^a than A(3) = (M.*V./(B+C.*A(2))).^a and etc (but I don't know my tolerance and in recommendations it's said three iterations are enough). But problem that M and V variables are matrices and C is a vector. It means first I need to take each value from each cell in matrix and iterate inside this cell. The size of my matrices let's say NxM and my result has to be a matrix NxM. I can not understand how to write the loop for these equation.
The most complicated for me is how in each iteration for defined cell use the same variables from matrices but change my I inside each cell. If I have for example three iterations for cell 1 it has to be looked like this
A(2) (1,1)= (M(1,1).*V(1,1)./(B(1,1)+C(1,1).*A(1)(1,1))).^a
A(3) (1,1)= (M(1,1).*V(1,1)./(B(1,1)+C(1,1).*A(2)(1,1))).^a
A(4) (1,1)= (M(1,1).*V(1,1)./(B(1,1)+C(1,1).*A(3)(1,1))).^a
And I need to save the last iteration A(4) and put in the first cell A(1,1) and in the end I have to get a matrix of A[NxM]
I hope I explained clearly. Thank you!
This code gives me just one value
for j=1:size1
for k=1:size2
I = zeros(size(vp));
for m=2:4
I(1)=0;
I(m) = (m5(j,k)./(m6(j,1)+m7(j,1).*I(m-1).^(a-1)./m8)).^(1/m1);
end
I(j,k)=I(m);
end
end