How can I put these subplots into a for loop?
이전 댓글 표시
Hello,
I have 1000 points of data (NumKey) I would like to divide into 10 different suplots each showing 100 points of the data. Every other data point is a random number which is why they are markered differently('*' being a random number). I started doing it manually, but am trying to figure out how to make it into a for loop.
I get a bit confused with nested for loops, so I would appreciate any advice.
Thank you in advance!
ntrials=1:100:1000;
figure;
subplot(10,1,1)
ntrials=1:numel(NumKey);
plot(ntrials(1:2:100),NumKey(1:2:100),'o');
hold on
plot(ntrials(2:2:100),NumKey(2:2:100),'*');
yticks([1 2 3 4]);
subplot(10,1,2)
ntrials=1:numel(NumKey);
plot(ntrials(101:2:200),NumKey(101:2:200),'o');
hold on
plot(ntrials(102:2:200),NumKey(102:2:200),'*');
yticks([1 2 3 4]);
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Subplots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!