How Does the 'All' Option Affect the Result of Symbolic simplify?

조회 수: 18 (최근 30일)
Paul
Paul 2025년 10월 14일 2:24
편집: Paul 2025년 10월 14일 2:28
Start with a simple expression
syms alpha beta real
f = cos(beta)-cos(beta)*cos(alpha)^2
f = 
and try to simplify it:
simplify(f)
ans = 
I was expecting the obvious substitution of sin(alpha)^2, but maybe not so obvious to the symbolic engine.
Try 20 steps and return all of the results.
A1 = simplify(f,20,'All',true);
Check the first result
A1(1)
ans = 
Do the same with 1000 steps
A2 = simplify(f,1000,'All',true);
A2(1)
ans = 
I was expecting that the first result, if not the first 20 results, would be the same form both calls to @doc:simplify.
Why does asking for more steps change the result in the first step?
Its looks odd that it takes more than 200 steps to return (arguably?) the simplest result that I suspect most users would be expecting.
simplify(f,200)
ans = 

답변 (0개)

카테고리

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

태그

제품


릴리스

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by