Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
I need the results as matrices but in loop please see following
조회 수: 1 (최근 30일)
이전 댓글 표시
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
John D'Errico
2020년 8월 24일
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.
답변 (1개)
Steven Lord
2020년 8월 24일
편집: Steven Lord
2020년 8월 24일
Can you define variables with numbered names like X1, X2, X3, ... ? Yes.
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!