USE MATLAB

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

USE MATLAB

Post by answerhappygod »

USE MATLAB
Use Matlab 1
Use Matlab 1 (36.49 KiB) Viewed 45 times
2. Script m-file: Quadratic Formula The solution to the quadratic equation: ar? +bx+c=0 15: x = - 5+1b2-4ac 2a a. Create an m-file that will find the roots of a quadratic equation, and print them out. Your m-file should 1. ask the user for the values of coefficients a, b and c. 2. check if a=0. If so, solve for the single root. 3. print out the root(s), real and imaginary. Your file should also tell the user, in words, if: • the roots are real and distinct (2 real roots). the roots are real and the same (1 double root). • the roots are complex and distinct (2 complex roots). . there is only one root (e.g., when a = 0). Bonus: Warn the user that there is no solution if a and b are both zero. b. Show your electronic file to the instructor for testing c. Print the completed m-file. A complete m-file includes your name and date in comment lines at the top of the m-file. Do not forget to use comment lines throughout the file to explain what key parts of the m-file are supposed to do.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply