Borrar filtros
Borrar filtros

Symbolic function expected 3 inputs and received 2

1 visualización (últimos 30 días)
Usman Saleem
Usman Saleem el 10 de Mzo. de 2021
Respondida: Cris LaPierre el 10 de Mzo. de 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!

Respuesta aceptada

Cris LaPierre
Cris LaPierre el 10 de Mzo. de 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.

Más respuestas (0)

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by