Effacer les filtres
Effacer les filtres

how can i use matlab with slope along the curve

4 vues (au cours des 30 derniers jours)
sabah
sabah le 8 Fév 2015
i have w= 0.00229*r0^(-5/3)*f^(-11/3) how can i fond the slope from this forml where r0 is matrix (99*71)also f is (99*17)

Réponses (1)

Star Strider
Star Strider le 8 Fév 2015
I assume both ‘f’ and ‘r0’ are the same size (either (99x17) or (99x71)), otherwise the calculation will not work.
For the slope, I would use the gradient function, with two outputs (since ‘w’ is a matrix):
w= 0.00229*r0.^(-5/3).*f.^(-11/3);
[Wx, Wy] = gradient(w);
Here, ‘Wx’ and ‘Wy’ are the slopes in the x and y directions respectively. See the documentation for gradient for details.
Note that you need to vectorise your ‘w’ assignment calculation for it to work.

Community Treasure Hunt

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

Start Hunting!

Translated by