error using Solve with inequality
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Shan  Chu
      
 el 7 de Jun. de 2019
  
    
    
    
    
    Comentada: Shan  Chu
      
 el 10 de Jun. de 2019
            Hi all,
I am facing a strange problem with using Solve with inequality.
Could you please help?
Thanks

2 comentarios
  Torsten
      
      
 el 7 de Jun. de 2019
				Why strange ?
Isn't 
4^2-4*4+3 > 0 and 0^2-4*0+3 > 0
as well as
e^2-4*e+3 < 0 and 2^2-4*2+3 < 0
?
Respuesta aceptada
  John D'Errico
      
      
 el 10 de Jun. de 2019
        
      Editada: John D'Errico
      
      
 el 10 de Jun. de 2019
  
      You did not follow the example carefully.
syms x
>> S = solve(x^2 - 4*x + 3 < 0,'returnconditions',true)
S = 
  struct with fields:
             x: [2×1 sym]
    parameters: [1×2 sym]
    conditions: [2×1 sym]
>> S.conditions
ans =
 1 < x & x < 3
 in(y, 'real')
Note the use of returnconditions. Without that, it gives a solution, but not the interval that you desire. So if I drop that property, we get a solution. It is valid, as you say. But just a solution.
S = solve(x^2 - 4*x + 3 < 0)
S =
 exp(1)
      2
Más respuestas (0)
Ver también
Categorías
				Más información sobre Calculus en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



