how can i use matlab with slope along the curve
1 view (last 30 days)
Show older comments
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)
0 Comments
Answers (1)
Star Strider
on 8 Feb 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.
0 Comments
See Also
Categories
Find more on Whos in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!