Find max gradient in a slope

32 vues (au cours des 30 derniers jours)
Marthe Fenne Vestly
Marthe Fenne Vestly le 5 Nov 2017
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?

Réponses (2)

Image Analyst
Image Analyst le 5 Nov 2017
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 le 5 Nov 2017
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])

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by