cannot call or index into a temporary array

1 view (last 30 days)
I created symbolic code:
clear all
syms p1 p2 p3 e1 e2 e3 a u w gw alpha beta y1 y2 real
F = ((((y1+1i*y2)*(y1+1i*y2)-w^2*e1)^(1/2))/e1)*tanh((((y1+1i*y2)*(y1+1i*y2)-w^2*e1)^(1/2))*a)*(1+((((y1+1i*y2)*(y1+1i*y2)-w^2*e3)^(1/2))/e3)*(e2/(((y1+1i*y2)*(y1+1i*y2)-w^2*e2)^(1/2)))*tanh((((y1+1i*y2)*(y1+1i*y2)-w^2*e1)^(1/2))*(u-a)))+((((y1+1i*y2)*(y1+1i*y2)-w^2*e2)^(1/2))/e2)*tanh((((y1+1i*y2)*(y1+1i*y2)-w^2*e2)^(1/2))*(u-a))+(((((y1+1i*y2)*(y1+1i*y2)-w^2*e3)^(1/2))/e3));
ReF = (real(F));
ImF = (imag(F));
diffFA = (diff(ReF, y1));
diffFB = (diff(ReF, y2));
F1 = -(1/((diffFA^2 + diffFB^2)^2))*(ReF*diffFA - ImF*diffFB);
F2 = -(1/((diffFA^2 + diffFB^2)^2))*(ReF*diffFB + ImF*diffFA);
But after substituting the resulting expression in the m-файл (dy1 = F1, dy2 = F2) I got the following error in terms D(conj)(...) of the expression "cannot call or index into a temporary array". Please, tell me, what's the problem?

Answers (0)

Community Treasure Hunt

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

Start Hunting!