Is there a search algorithm I can apply to a dataset that I do not have a specific F(x,y) function for?

1 回表示 (過去 30 日間)
Hello,
I am looking for the best search algorithm for the following set of data:
I have a set of temperature values T(x,y) which I want to find a minimum of; it is important to note that I do not have a specific function (such as T(x,y)= x^2+y^2), just the points. I haven't found a search function that works on raw data (without a function handle), but I'm a little out of my element so I may have misunderstood the documentation.
What I would like to do is to have the algorithm start at the maximum T value, then show the path it takes to the minimum T value. I want to be able to overlay the path on data for presentation. For what it's worth, the data is relatively well behaved, so there is a well defined global maximum and few peaks between the maximum and minimum.
Thank you for any direction you can offer,
Matt
Edit1: This does take place on a square grid.

採用された回答

Walter Roberson
Walter Roberson 2018 年 1 月 23 日
To get a path between min and max, first find out which nodes are min and max, and then create a graph() representation of the system and use shortestpath() to find the way between them.
A key bit here is that you have to decide which nodes are connected to which. You did not say that you have a grid of points, so we as onlookers cannot assume that nodes are connected in any particular manner: in what you have given so far, it is not clear that the path could not simply go from max to min in one angled step.
  4 件のコメント
Matthew
Matthew 2018 年 1 月 23 日
Thanks Walter,
I am accounting for the diagonals, but I was not aware of the 'setdiff' function. I think I can apply this to solve my problem.
Matt P.
Walter Roberson
Walter Roberson 2018 年 1 月 23 日
I think I posted code to construct an appropriate mesh about 4 or 5 months ago, but it would take me a while to find it.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by