Can someone help me with symbolic differentiation?
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (2)
Andrei Bobrov
le 25 Avr 2013
TempVar2 = jacobian(Phi,Var);
Paulo Francisco
le 25 Avr 2013
0 votes
Catégories
En savoir plus sur Common Operations dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!