How to generate different variables to store different sets of matrix?
조회 수: 1 (최근 30일)
이전 댓글 표시
Using for loop, 35 different matrices are generated in my codes. How can I generate 35 different variables to store them respectively?
댓글 수: 0
채택된 답변
Star Strider
2014년 11월 15일
Just DON’T!
Create a multidimensional matrix, or if your matrices are different sizes, use a cell array.
댓글 수: 4
Star Strider
2014년 11월 15일
My pleasure!
If you want to call the matrix created at iteration 20 of the loop, you can refer to it as:
M(:,:,20)
However if you want to do calculations with it, it’s sometimes easier to create a separate temporary matrix for it, for instance:
Mt = M(:,:,20);
to avoid having to write all the subscripts each time you use it in your calculations.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!