graphing only portions of data

조회 수: 2 (최근 30일)
Joseph
Joseph 2014년 4월 3일
답변: Joseph Cheng 2014년 4월 3일
I have 20,000 data points. my objective is to have 4 subplots. each with a different number of data points. subplot 1 has the first 250, subplot 2 has the first 2500, sub plot 3 has first 5000, etc.
I have the code for all the points, struggling to get the different amounts of points per graph. here is my code...
x(1)=0;
y(1)=0;
for k = 1:1:19999
x(k+1) = y(k)*(1+sin(.7*x(k))) - 1.2*sqrt(abs(x(k)));
y(k+1) = .21 - x(k);
end
plot(x,y,'o','markersize',2)
  댓글 수: 1
Joseph
Joseph 2014년 4월 3일
I know I can use extra for loops, but my objective is to do it with just the one

댓글을 달려면 로그인하십시오.

채택된 답변

Joseph Cheng
Joseph Cheng 2014년 4월 3일
you don't need any for loops to do this.
subplot(4,1,1),subplot(x(1:250),y(1:250));
subplot(4,1,2),subplot(x(1:2500),y(1:2500));
subplot(4,1,3),subplot(x(1:5000),y(1:5000));
subplot(4,1,4),subplot(x(1:20000),y(1:20000));

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by