Find max gradient in a slope
26 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(2 个)
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.
0 个评论
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])
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!