Finding approximate real solution to a equation
    11 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Vinit Nagda
 el 22 de Sept. de 2021
  
    
    
    
    
    Comentada: Vinit Nagda
 el 22 de Sept. de 2021
            Can anyone please help me, how to find the approximate real solution to the following polynomial:
syms x
eqn=0.0941*x^3+0.1926*x-1500;
I used solve and simplify functions, but I don't get a real value.
0 comentarios
Respuesta aceptada
  Alan Stevens
      
      
 el 22 de Sept. de 2021
        You don't need syms here.  Try the roots function.
help roots
3 comentarios
  Alan Stevens
      
      
 el 22 de Sept. de 2021
				You could try something like
coeffs = [0.0941, 0, 0.1926, -1500];
r = roots(coeffs);
indicator = find(r==real(r));
disp(r(indicator))
Más respuestas (0)
Ver también
Categorías
				Más información sobre Symbolic Math Toolbox 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!

