Can someone help me with symbolic differentiation?
1 view (last 30 days)
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
0 Comments
Accepted Answer
Wayne King
on 25 Apr 2013
The immediate cause of your problem is that MATLAB is case-sensitive and you want to use diff(), not Diff()
0 Comments
More Answers (2)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!