Convert the for loop into while loop.
조회 수: 5 (최근 30일)
이전 댓글 표시
matrix=[6 3 5; 8 4 6; 2 1 9;7 5 2]
[r,c]=size(matrix);
for Row=1:r
for Col=1:c
fprintf('Element(%d,%d)=%d.\n',Row,Col,matrix(Row,Col))
end
end
참고 항목
카테고리
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!