Quadratic question using the function command
243 views (last 30 days)
Without using the roots command, write a function to calculate roots of the quadratic equation
Inputs to the function should be the coefficients a, b and c and output should
be the roots. Test your program by setting a=2, b=3 and c= -1
So I know i have to have two files. One with the quadratic equations and the other script recalls the function. Heres What I have so far.
Thats the first file
And I am lost on what to do with the second file
Walter Roberson on 25 Jun 2013
In MATLAB, files that define functions must have "function" as the first non-comment word in the file; if you put assignments before the "function" statement then you will get an error about function definitions not permitted in that context.