Has solve() changed its behaviour if the solution to the equation is all real numbers?
    2 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    Andreas
      
 am 14 Jul. 2015
  
    
    
    
    
    Beantwortet: Ghada Saleh
    
 am 16 Jul. 2015
            Hello,
to test a real function for special symmetry (See if it is even or odd) with the Matlab Symbolic Math Toolbox I have used the following code:
syms x real;
f(x) = x^2;
solve(f(x) == f(-x), x)
Expected result is
R_
Which is as far as I understand the Mupad Syntax for all real numbers. This Result was given until and including release R2014a.
From release R2014b on, I just get
0
which is obviously one single solution, but not all solutions to the equation.
In the release notes I did not see anything interesting about solve.
0 Kommentare
Akzeptierte Antwort
  Ghada Saleh
    
 am 16 Jul. 2015
        Hi Andreas,
This is an issue in MATLAB R2014b and later versions. As a workaround you can use the following command:
[solx param cond]  = solve(f(x) == f(-x), x, 'ReturnConditions', true)
I hope this helps.
Ghada
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Special Values finden Sie in Help Center und File Exchange
			
	Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

