Removing data that exceeds y limit in a plot
조회 수: 16(최근 30일)
표시 이전 댓글
댓글: Hussein Kokash 2021년 7월 13일
I have this plot function which I use to plot data, I set the y axis range using ylim
The output looks like this:
I want to edit my script so that the plot eliminates the data that have y values out of this range [-1e-5 1e-5]
Meaning that only show the corresponding y values that are within the y range between -1e-5 and 1e-5.
Thank you so much!
댓글 수: 0
ANKUR KUMAR 2021년 7월 13일
You can set range while calling the plot function. This is just an example. I am setting the limit as [-0.5,0.5]. You can change that as per your need.
plot(x(y>-0.5 & y<0.5),y(y>-0.5 & y<0.5))
댓글 수: 1
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!