Symbolic toolbox not simplifying adequately

I'm using MATLAB Live Editor along with the symbolic toolbox. The following expression is not getting simplified. Any fixes?
I've tried using simplify to no avail.
Thanks,
Mohit.

 Risposta accettata

syms alpha F R
simplify((3*F*R^2*alpha)/64 - 3*R*sqrt(F^2*R^2*alpha^2)/64,...
'IgnoreAnalyticConstraints', true)

6 Commenti

Right. The two parts are not the same if some of the values are negative.
Ah of course! MATLAB doesn't recognise that the values are purely real. Thanks!
MATLAB doesn’t have “Mind Reading Toolbox” ;)
real is not enough: consider negative real numbers.
You can add assumptions to symbols such as
syms alpha positive
syms R
assume(R>=0)
Right, understood. Thanks guys!
Great, thanks!

Accedi per commentare.

Più risposte (0)

Categorie

Prodotti

Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by