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

1 visualización (últimos 30 días)
talayeh tavangar
talayeh tavangar el 17 de Abr. de 2020
Respondida: Matt J el 18 de Abr. de 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

Respuestas (1)

Matt J
Matt J el 18 de Abr. de 2020
Should the left hand side be S{i,j,k} ?

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by