MATLAB moving a point in the XY plane

后端 未结 2 1562
傲寒
傲寒 2020-12-22 05:42

In MATLAB, I have an XY plane that is represented by finite number of points. The possible values of x are stored in a vector X and the possible values of y are stored in an

2条回答
  •  心在旅途
    2020-12-22 06:39

    lets say A = [Xcenter Ycenter]

    for K-hop, you can access points:

    pointsX = [];
    pointsY = [];
    for i=-k:k
      pointsX = [pointsX  Xcenter+i]; 
      pointsY = [pointsY  Ycenter+i];
    end
    

    Furthermore, you can filter these points by order coordinates and remove the outliers. e.g. consider

    (1,1)  (1,2)  (1,3)
    (2,1)  (2,2)  (2,3)
    (3,1)  (3,2)  (3,3)
    

    Now you know that minimum allowed X and Y are 1, so just filter out points with any ordinate and/or abscissa lesser than that.

提交回复
热议问题