how can i use matlab with slope along the curve
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Star Strider
el 8 de Feb. de 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 comentarios
Ver también
Categorías
Más información sobre Whos en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!