A Varying matrix name in loop
    조회 수: 5 (최근 30일)
  
       이전 댓글 표시
    
I have a loop running from i=1 to N where N is unkown and inputted by the user and the commands in the loop generates a matrix and i would like the first loop to give me matrix1 and the second loopd to give me matrix2 so the matrix name is changed based on the i value, but im not really sure how to go about this problem
댓글 수: 1
채택된 답변
추가 답변 (1개)
  madhan ravi
      
      
 2020년 6월 8일
        N = 2; % example
matrix = cell(N,1);
for k = 1:N
    matrix{k} = rand;
end
celldisp(matrix)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



