Find path along steepest gradient in an array

I want to find the path along the steepest gradient in an array of data points. I started using the 'diff function' and the 'for loop' to get information about the maximum difference between two data points. I got stuck. Would be great if someone know how to do that. Attached is the data file.

댓글 수: 4

KSSV
KSSV 2017년 8월 23일
Can you tell me what do you mean by path along steepest gradient? A pictorial demo of the path will be helpful..
Phil A
Phil A 2017년 8월 23일
I plotted the data attached. They are depth in meters. The cyan lines are paths. Now I want to add another path that runs along the the steepest gradient. For example, I start at the deepest point, e.g. -680 meter. From there I want to pick the point next to it with the greatest difference in these points. So if the neighbored points are -650m, -658m, and -656m I want to chose -650m because -680m - (-650m) = -30m which is the greatest difference between the stated points. Did that make it more clear?
Jan
Jan 2017년 8월 23일
편집: Jan 2017년 8월 23일
Do you want to consider the 4 surrounding points, or the 8 points including the diagonally neighboring elements?
If the matrix is a real measurment, the method of the steepest descent will probably end in a local maximum cause by noise. It is not really useful to create a simple code, which checks the values of the direct neighbors only, but fitting the local neighborhood by a polynomial and a line-search algorithm might be more stable.
Phil A
Phil A 2017년 8월 23일
Also the diagonally points.

댓글을 달려면 로그인하십시오.

답변 (1개)

John D'Errico
John D'Errico 2017년 8월 23일
편집: John D'Errico 2017년 8월 23일

0 개 추천

You have what appears to be a complete surface, a noisy one, but still.
Why cannot you just use a tool like gradient to compute gradients at any point. Then use quiver to show the lines of steepest descent? Effectively, the direction of steepest descent at any point is simply the negative gradient. That also gives you local magnitude of the gradient, so the length of the vector will show the size of the local descent.
Since it seems a bit noisy, you might wish to smooth the surface first a bit. There are many smoothing tools available.

카테고리

도움말 센터File Exchange에서 Smoothing에 대해 자세히 알아보기

질문:

2017년 8월 23일

편집:

2017년 8월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by