Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

I need the results as matrices but in loop please see following

1 visualización (últimos 30 días)
Venkata Rama Krishna Gona
Venkata Rama Krishna Gona el 24 de Ag. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
i=1;
n=2;
for i=1:n
G= zeros(n,n);
G = Angular_vel(i,i)*Angular_vel(i,i)*I;
end
here G value is getting overrided for second time and G is matrix. i need 'n' number of matrices as result. please help
  2 comentarios
John D'Errico
John D'Errico el 24 de Ag. de 2020
No. You don't need n number of matrices. Just learn to use 3-d arrays. Or just learn to use cell arrays. Your problem is not what you think you need, but that you don't know how to use the tools available.
Create a matrix of size nxnxn. That is effectively n arrays, each of size nxn. You can access any one of them simply and use it as you wish.

Respuestas (1)

Steven Lord
Steven Lord el 24 de Ag. de 2020
Editada: Steven Lord el 24 de Ag. de 2020
Can you define variables with numbered names like X1, X2, X3, ... ? Yes.

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by