How to create a loop for a matrix and plot the outputs in a graph?
이전 댓글 표시
I have a matrix that is called merged, the matrix is 100 x 2. I want to create a loop that breaks down the matrix into 5 small matrices (20 x 2) and I want to draw these matrices in one figure. I have done that using the below commands but I wonder if I can do that using a loop?
x = merged (1:100,1:2); a = x (1:20,:); b = x (21:40,:); c = x (41:60,:); d = x (61:80,:); e = x (81:100,:); hold on plot (a(:,1),a(:,2)) plot (b(:,1),b(:,2)) plot (c(:,1),c(:,2)) plot (d(:,1),d(:,2)) plot (e(:,1),e(:,2))
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Graphics Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!