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!