Error using mupadengin​e/feval_in​ternal Arithmetical expression expected.

조회 수: 5 (최근 30일)
yasin yalcin
yasin yalcin 2021년 9월 5일
답변: Walter Roberson 2025년 5월 6일
67- syms a b
68- eqns=[delta_T==rho*4*pi*r(i)*V_inf^2*(1+a)*a*dr ,delta_Q==rho*4*pi*r(i)^3*V_inf*(1+a)*b*omg*dr];
69- S=vpasolve(eqns,[a b]);
Error using mupadengine/feval_internal
Arithmetical expression expected.
Error in sym/vpasolve (line 172)
sol = eng.feval_internal('symobj::vpasolve',eqns,vars,X0);
Error in untitled (line 69)
S=vpasolve(eqns,[a b]);
  댓글 수: 1
Walter Roberson
Walter Roberson 2025년 5월 6일
Seems okay with a naive implementation.
syms a b
delta_T = rand();
rho = rand();
i = 1; r(i) = rand();
V_inf = rand();
dr = rand();
delta_Q = rand();
omg = rand();
eqns=[delta_T==rho*4*pi*r(i)*V_inf^2*(1+a)*a*dr ,delta_Q==rho*4*pi*r(i)^3*V_inf*(1+a)*b*omg*dr];
S=vpasolve(eqns,[a b])
S = struct with fields:
a: [2x1 sym] b: [2x1 sym]
We would have to know the value of the various variables. I suspect one or more of them are not numeric.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2025년 5월 6일
According to a previous thread, the problem is that one of the expressions generates NaN

Community Treasure Hunt

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

Start Hunting!

Translated by