开发者

Command for cutting matlab plot from the middle

开发者 https://www.devze.com 2023-03-27 07:55 出处:网络
I am trying to plot a dataset and want to see a small portion of the plot in the display. The开发者_如何学运维 problem is that the dataset is huge and when I am running the algorithm on the whole data

I am trying to plot a dataset and want to see a small portion of the plot in the display. The开发者_如何学运维 problem is that the dataset is huge and when I am running the algorithm on the whole dataset the significant change in the plot is not clear (visually). Thats why I want to run the algorithm on the whole dataset and want to view a portion of the resulting plot in the display, say 10% of the plot from the middle. Can anyone please help me how to cut the M-figure from the middle - 10% of the original plot? Thanks in advance.


Suppose you're plotting x.

L = length(x);
fraction = 0.1;        %#plot 10% of signal
n = round(L*fraction); %#number of samples/points to plot
offset = 0.5           %#start plotting at 50% of the signal (middle)
s = round(L*offset)    %#number of samples/points to skip before plotting

t = s:s+n-1;           %#discrete 'time' vector, so you know where you are on the plot

plot(t,x(t));          %#plot the selected signal portion


Do xlim, ylim and zlim do what you want?

0

精彩评论

暂无评论...
验证码 换一张
取 消