Find max gradient in a slope

조회 수: 15 (최근 30일)
Marthe Fenne Vestly
Marthe Fenne Vestly 2017년 11월 5일
답변: Image Analyst 2017년 11월 5일
I have computed displacement depending on slope angle and the result is the plot below. Now I want to find the slope angle where the displacement increases the most, but i can´t figure out how the gradient commands works. Does anyone have a suggestion how to get this information?

답변 (2개)

Image Analyst
Image Analyst 2017년 11월 5일
It looks like the displacement increases the most at the last slope angle of each layer. Thus, for layer1, where you have arrays displacement1 and slopeAngle1, the slope where the displacement increases the most would simply be slopeAngle(end). Same for the other 5 layers.

Star Strider
Star Strider 2017년 11월 5일
The gradient (link) function assumes a constant step in each direction you want to calculate. You have to experiment with it with your data to get the result you want.
This should get you started:
t = linspace(0, 25);
x = (1:5)/125;
f = exp(bsxfun(@times, t(:), x)); % Column-Major Array (‘t’ Increases Down Columns)
[drow,dcol] = gradient(f, x, t); % ‘drow’: Across Rows; ‘dcol’: Down Column
figure(1)
semilogy(t, f)
grid
figure(2)
surf(x, t, f)
hold on
mesh(x, t, dcol)
hold off
grid on
view([120 25])

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by