could anyone tell me how to display the row size of the matrix,if the size of the row keeps on changing.
조회 수: 1 (최근 30일)
이전 댓글 표시
could anyone tell me how to display the row size of the matrix,if the size of the row keeps on changing.
댓글 수: 0
채택된 답변
Image Analyst
2018년 1월 15일
Try this wherever you want to report the number of rows:
message = sprintf('The number of rows = %d.\n', size(yourData));
fprintf('%s', message);
uiwait(helpdlg(message));
댓글 수: 3
Image Analyst
2018년 1월 16일
Try this:
rows1 = size(data1);
rows2 = size(data2);
rows3 = size(data3);
rows4 = size(data4);
rows5 = size(data5);
maxRows = max([rows1, rows2, rows3, rows4, rows5]);
for row = 1 : maxRows
if row <= rows1
% Process data1.
end
if row <= rows2
% Process data2.
end
if row <= rows3
% Process data3.
end
if row <= rows4
% Process data4.
end
if row <= rows5
% Process data5.
end
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!