how i plot specified point from signal ?

how i plot specific point from signal, for example: i want to plot just the points that have y different to zero?

5 Comments

plot(y(y~=0),'+') % plots point other than y=0
madhan ravi, in this case index of the points where that have y not a zero appear in linear successive 1 2 3 4, but in reality 1, 6 ,7
Please upload an example and your desired output so that it's clear you want to plot y against which parameter because if the x axis parameter is not defined then it's plotted against index.
New Bitmap Image.bmp
I want to draw the points that have different "y" a zero and keep his index in the original

Sign in to comment.

 Accepted Answer

Adam Danz
Adam Danz on 6 Feb 2019
Edited: Adam Danz on 6 Feb 2019
If your data were plotted with
plot(x,y)
and you want to only plot data where y~=0, then first find the indices where y~=0 and eliminate them from both x and y.
yKeep = y~=0;
plot(x(yKeep), y(yKeep))
If you have data that are very close to 0 but not equal to zero (ie, 0.000001) and you want to eliminate them as well, use ismembertol().

More Answers (0)

Categories

Tags

Community Treasure Hunt

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

Start Hunting!