Symbolic function expected 3 inputs and received 2

3 次查看(过去 30 天)
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!

采纳的回答

Cris LaPierre
Cris LaPierre 2021-3-10
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 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by