make several matrices in a for loop
조회 수: 14 (최근 30일)
이전 댓글 표시
Make various matrices in one for loop. Hellow, its problaly very easy but i cant find it nowhere.
I want to make a program that produces several matrices. to make ten matrices i tried:
for i=0:10
matrix[i] = rand(12,12)
end
to make 10 matrices with 12x12 random numbers but i doesnt work. Thx in advance
댓글 수: 0
채택된 답변
추가 답변 (1개)
Walter Roberson
2011년 5월 1일
First off, you want to create 10 matrices but you execute the loop 11 times.
Secondly, indexing at 0 does not work for any predefined MATLAB array types.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!