Function writing in MATLAB in symbolic format

1 vue (au cours des 30 derniers jours)
Chandan
Chandan le 22 Mar 2023
Commenté : Walter Roberson le 22 Mar 2023
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?

Réponses (1)

Paul
Paul le 22 Mar 2023
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 commentaire
Walter Roberson
Walter Roberson le 22 Mar 2023
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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by