Borrar filtros
Borrar filtros

why can't my 2nd output argument in my function return any value?

1 visualización (últimos 30 días)
Hi, I 'm trying to create a function that calculates the root from the the quadratic eqn. i need to display the two roots separately but why does my second root, k not appear from the output.argument. thanks i am new to matlab

Respuesta aceptada

Star Strider
Star Strider el 4 de Dic. de 2015
You have to ask it specifically for as many outputs as you want it to return. By default, if you only ask it for one, it will only return the first. This call returns all of them:
a = 2;
b = 5;
c = 10;
[j,k,group]=quadratic_roots(a,b,c)
Also, I would change:
group='non-equal complex valued roots'
to:
group='complex-conjugate roots'
  11 comentarios
Star Strider
Star Strider el 5 de Dic. de 2015
@Natalia — If my Answer solved your problem, please Accept it.
@Walter — Thank you.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by