Gradient of vector-valued function
11 次查看(过去 30 天)
显示 更早的评论
Code below throws an error. How is it possible to get the gradient for a vector-valued function?
syms a b1 b2 t
mfcn = matlabFunction(b1.*t^2+b2.*t, 'Vars', {[b1,b2],t})
gradient(mfcn,t)
0 个评论
回答(2 个)
VBBV
2022-12-17
use diff instead of gradient which is equivalent for gradient operation for symbolic expressions
syms a b1 b2 t
mfcn = matlabFunction(b1.*t.^2+b2.*t,'Vars', {b1,b2,t})
diff(mfcn,t) % use diff instead of gradient
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!