1. Engineering
  2. Computer Science
  3. matlab question please please answer each and every part thank...

Question: matlab question please please answer each and every part thank...

Question details

3. Write a program in a script file (not a function) that determines the real roots of a quadratic equation ax2 + bx +c0. Name the file Hw2_3 lastnamefirstinitial.m. When the file runs, it should ask the user to enter the values of the constants a, b, and c. To calculate how many roots in the equation, use the discriminant Db2 - 4ac. If D>0, the program should display a message: The equation has two roots, and the roots are displayed on the next line If D=0, the program should display a message: The equation has one root, and the root is displayed on the next line. If D<0, the program should display a message: The equation has no real roots. Run the script file in the Command Window for the following test cases: 2x2 + 8x - 3 0, 15x2 + 10x +5 0, and 18x2 12x +2 0. Include a screenshot of your neatly formatted code and the test case output in your PDF file that you submit to Gradescope, and also upload your m-file to the Homework 2 dropbox in the Assignments area on Canvas.

Matlab question please!

Please answer each and every part. Thank you very much.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution