how can i use matlab with slope along the curve
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Star Strider
2015-2-8
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!