Filter löschen
Filter löschen

Enforcing grouping in the Symbolic Math toolbox

2 Ansichten (letzte 30 Tage)
Arwel
Arwel am 25 Feb. 2020
Beantwortet: Walter Roberson am 28 Feb. 2020
Hi,
I have a question regarding controlling the grouping of terms in the symbolic math toolbox. I've tried to figure out how to put the question directly into this window, but couldn't figure it out. So, in the end I've exported the relevant live worksheet as a PDF and attached it to this question...
But essentially, I want to control how Matlab groups terms. In the attached, I want to stop matlab splitting up f_siw1 when I substitute it into Dsi_w1 (it doesn't make sense for later in the calculation to split them).
How can I do this, or control the grouping of terms generally? Is there a syntax that will let me do this?
Cheers,
Arwel
  1 Kommentar
Devineni Aslesha
Devineni Aslesha am 28 Feb. 2020
In the attached PDF, the desired expression and the answer obtained using ‘subs’ function in MATLAB are same. Also, could you provide information on how it doesn't make sense later on in the calculation to split them?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 28 Feb. 2020
You need to use either evalin(symengine) or feval(symengine) to issue commands directly to the symbolic engine, and you would have to issue hold() calls at appropriate places.
This is a difficult construct to use well, and your symbolic engine might reset if you try to display the expression.
https://www.mathworks.com/help/symbolic/mupad_ref/hold.html

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by