Create an Array of points with highest slopes covering all points in an array!

1 回表示 (過去 30 日間)
Aviator
Aviator 2011 年 12 月 27 日
Hi,
I'm developing a GUI and came across a problem have a double array, x, which is an nx2 array and represents some points in a coordinate system; column 1 contain the x's and column 2 are the y's. I want to calculate the slopes between these points as follows:
  • take the first row (point 1) and calculate the slopes between this point and all subsequent points in x.
  • find the point that has the max slope WRT point 1 (when point 1 is the origin), this is point 2.
  • find the third point with max slope WRT point 2. This third point is a point that is after point 2 (index-wise).
  • then find a point with max slope WRT point 3 (index-wise, it's after point 3).
  • this should continue until all points in x is covered.
  • I'm just looking for points 2, 3, ....end as indexes of x as explained above...
By the way, calculating slopes between points is not an issue but the way it should be programmed to get these points is the point of this question. Any help is greatly appreciated!!!
Thanks!

回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by