How to define an array with multiple columns for each parameter in a for loop?
조회 수: 3 (최근 30일)
이전 댓글 표시
I have a loop where each parameter should create an array with 20 columns so for n=1, there's 20 columns in the array, n=2, there's 20 columns in the array etc; so the final array should have 20*sz columns but am not sure how to code this (attempt below):
for n=1:sz
array(:,20]);
end
댓글 수: 0
채택된 답변
James Tursa
2017년 1월 9일
At each iteration, the array sub-section indexing would be:
array(:,n*20-19:n*20)
댓글 수: 0
추가 답변 (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!