Function writing in MATLAB in symbolic format

조회 수: 1 (최근 30일)
Chandan
Chandan 2023년 3월 22일
댓글: Walter Roberson 2023년 3월 22일
I have been trying wrting this equation (screenshot1) in MATLAB in symbolic format. Mathematically, my equation is correct. But it is always giving me error (screeenshot2). As you are seeing the the small piece of code written in screenshot2, can you please help me to write that equation symbolically?

답변 (1개)

Paul
Paul 2023년 3월 22일
It appears that the symfun objects have to have the same arguments (number and order) to add them
syms rho(x,y,z,t) rho_m(x,y,z,t) rho_p(x,y,z,t)
eq1 = rho(x,y,z,t) == rho_m + rho_p;
disp(eq1)
  댓글 수: 1
Walter Roberson
Walter Roberson 2023년 3월 22일
Right. The alternative is to invoke the symbolic functions on specific variables (turning them into expressions), add the expressions, and create a symbolic function from the result.

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

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by