MATLAB: Filter a matix column values

filterif statementplotscatter

I have a matrix with X and Y values for a trajectory. Also, distance and speed values.
I want to make a criteria(filter) for my speed or distance column; then, I will take those ralated XY points and plot/scatter them with different color code.
(for example, I want to plot XY points which distance is >1.5 for them).
The second goal which I am not sure if it is possible, is to plot these points on a figure which I plotted all XY points.

Best Answer

  • Let X,Y,D,V be your (x,y) locations, distance and velocity respectively.
    hold on
    legend('path','locations D>1.5')