Clear Filters
Clear Filters

remove points in a figure that are close to 0 vertical line

1 view (last 30 days)
Say I have:
X = [0 0.5 0.12 0.54 0.21 0.21 0.12 0.32 37 30 39 50 42]'
Y = [134 423 352 212 545 234 184 563 323 123 485 182 493]'
plot(X,Y,'g')
I want to remove points that are less than 'n' from the plot for X
Say n = 20, so points that are less than 20 in matrix X will be removed from the plot.

Answers (1)

Mathieu NOE
Mathieu NOE on 29 Jan 2021
hi
as simple as this :
X = [0 0.5 0.12 0.54 0.21 0.21 0.12 0.32 37 30 39 50 42]'
Y = [134 423 352 212 545 234 184 563 323 123 485 182 493]'
n = 20;
ind=find(X>n);
plot(X(ind),Y(ind),'g')

Categories

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!