Build arrays under the for loop
조회 수: 6 (최근 30일)
이전 댓글 표시
Hi;
for i=1:10
R"i"= nonzeros(D(i,:));
end
I want to create arrays under the for loop. The arrays wont have the same size. For each increment, the name of the array should be R + the increment number (R1, R2, R3 ....).
The desired result is 10 vectors R1 to R10.
Any hints to do it ?
Thank you in advance
댓글 수: 1
Stephen23
2023년 2월 13일
Use indexing. Indexing is a MATLAB superpower. If you do not use indexing, then using MATLAB will be very ... difficult.
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!