Symbolic function expected 3 inputs and received 2
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Usman Saleem
am 10 Mär. 2021
Beantwortet: Cris LaPierre
am 10 Mär. 2021
I want to compute the following code.
syms u(x,y,t) v(x,y,t) w(x,y,t) a1 a2 mu p(x,y,t) r x y
I=[1,0;0,1];
VV = [diff(u,x),diff(v,x);diff(u,y),diff(v,y)];
A1 = VV+transpose(VV);
A2 = diff(A1,t)+A1*VV+transpose(VV)*A1;
T = -p*I+mu*A1+a1*A2+a2*(A1)^2;
ANS1 = 1/r*(diff(T(1,1),x)+diff(T(1,2),y))
but gets the following error:
Error using symfun/subsref (line 141)
Symbolic function expected 3 inputs and received 2.
Error in as1 (line 27)
ANS1 = 1/r*(diff(T(1,1),x)+diff(T(1,2),y))
Need guidance!
0 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 10 Mär. 2021
T is a defined using p(x,y,t). This causes T to also be a function with the same 3 inputs.
However, when you call T in your calculation of ANSI, you use T(1,1) and T(1,2). There are only 2 inputs when 3 were expected.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!