gradient issue for matlab

Hi
I am trying to use the gradient function to have dq/dv and dv /dq . The martix has one direction is q and one is v but without titles for each one. My matrix size is 47 rows and 2 column.

 采纳的回答

KSSV
KSSV 2019-4-24
编辑:KSSV 2019-4-24
Let A be your 47X2 matrix.
q = A(:,1) ;
v = A(:,2) ;
dq_dv = diff(q)./diff(v) ; % dq/dv
dv_dq = diff(v)./diff(q) ; % dv/dq

1 个评论

Hi KSSV,
Thanks for your answer, is it possible by using the equations belwo
FX = gradient(F)
[FX,FY] = gradient(F)
[FX,FY,FZ,...,FN] = gradient(F)

请先登录,再进行评论。

更多回答(1 个)

If M is your matrix, have you tried imgradientxy()?
[gx, gy] = imgradientxy(M); % Requires Image Processing Toolbox.

类别

帮助中心File Exchange 中查找有关 Sparse Matrices 的更多信息

产品

标签

Community Treasure Hunt

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

Start Hunting!

Translated by