How to split into small pieces of ranges of this graph?

조회 수: 24 (최근 30일)
SZ N
SZ N 2021년 6월 13일
답변: Image Analyst 2021년 6월 14일
How to split into small pieces of ranges from this graph?
Range=[ ] ?
I am not sure how to cut these graphs into smaller parts to analyze them.
I keep getting this error!!
"Array indices must be positive integers or logical values."

답변 (2개)

LO
LO 2021년 6월 13일
편집: LO 2021년 6월 13일
this plots first the first half then the second
subplot 211
plot(x(1:numel(x)/2),y(1:numel(y)/2))
subplot 212
plot(x(numel(x)/2:end),y(numel(y)/2:end))
you can also plot other ranges or segment, just indicate the proper indexes for x and y (if you have only one variable per plot then forget about the y).
for example, the following lines plot the first 100 points in 1 subplot, the second 100 are plotted in the other
subplot 211
plot(x(1:100))
subplot 212
plot(x(101:200))
  댓글 수: 6
SZ N
SZ N 2021년 6월 13일
Thank you so much for your help!
LO
LO 2021년 6월 13일
You're welcome! Just mark the answer accepted if it fits😊

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


Image Analyst
Image Analyst 2021년 6월 14일
If you simply want to zoom in and look at a narrower viewport window, you can set the left and right ends of the x axis with the xlim() function. For example to have the graph show only the plot between 0.2 and 0.4, do
xlim([0.2, 0.4]);
after you've called plot().

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by