Can someone help me with symbolic differentiation?

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

 채택된 답변

Wayne King
Wayne King 2013년 4월 25일

0 개 추천

The immediate cause of your problem is that MATLAB is case-sensitive and you want to use diff(), not Diff()

추가 답변 (2개)

Paulo Francisco
Paulo Francisco 2013년 4월 25일

0 개 추천

Thank you both, it's working now.
Paulo

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by