Can someone help me with symbolic differentiation?
Show older comments
Hi,
I'm trying to differentiate a vector of fuctions in order to a vector of variables and I keep getting the error:
??? Undefined function or method 'Diff' for input arguments of type 'sym'.
My code is:
NVar=4;
NConstr=2;
syms x y z w;
Var=[x y z w];
Phi=[x+y+z+w;x*y+z^2+w^3*z];
for i=1:NConstr
for j=1:NVar
TempVar2=Diff(Phi(i,1),Var(j));
end
end
The purpose of this code is to aplly it to my master thesis, where I need to differentiate a (47X1) constraint vector in order to a vector of coordinates that is (102X1). Can anyone help me?
Best regards,
Paulo
Accepted Answer
More Answers (2)
Andrei Bobrov
on 25 Apr 2013
TempVar2 = jacobian(Phi,Var);
Paulo Francisco
on 25 Apr 2013
0 votes
Categories
Find more on Common Operations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!