Matrix line by line
조회 수: 1(최근 30일)
표시 이전 댓글
how can i go through a matrix line by line?
I have this matrix and would like to have the value of a spinner depending on the value.
x = [1:1:5; 6:1:10]
댓글 수: 0
채택된 답변
Walter Roberson
2021년 4월 20일
x = [1:1:5; 6:1:10; 11:15; 16:20; 21:25; 26:30; 31:35; [36, 0, -1, nan, nan]];
nrow = size(x,1);
for K = 1 : 5
spin = randi(nrow);
randrow = x(spin,:)
end
추가 답변(0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!