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

1 Ansicht (letzte 30 Tage)
talayeh tavangar
talayeh tavangar am 17 Apr. 2020
Beantwortet: Matt J am 18 Apr. 2020
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

Antworten (1)

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

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by