How can I save my result in a loop when it is an matrix

1 view (last 30 days)
Hi
I used the following code for save my result but it inly save the result for the last step. Can you help me with that, I want to save the resulted matrix in each step.
for i=1:10
for j=1:10
for k=1:100
S{k}=[1/v(i,j),-s(i,j)/v(i,j),-s(i,j)/v(i,j),0,0,0;-s(i,j)/v(i,j),1/v(i,j),-s(i,j)/v(i,j),0,0,0;...
-s(i,j)/v(i,j),-s(i,j)/v(i,j),1/v(i,j),0,0,0;0,0,0,(1+s(i,j))/v(i,j),0,0; 0,0,0,0,(1+s(i,j))/v(i,j),0;0,0,0,0,0,(1+s(i,j))/v(i,j);];
end
end
end

Answers (1)

Matt J
Matt J on 18 Apr 2020
Should the left hand side be S{i,j,k} ?

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!