Question
Consider the following quadratic equation. x 2 + 8x + 15 = 0 where a = 1, b = 8 and c = 15 Write
Consider the following quadratic equation.
x 2 + 8x + 15 = 0 where a = 1, b = 8 and c = 15
Write a MATLAB script file program using the basic commands(+/- * / ^) we discussed on Friday. In this program the first few lines of your code should include the statements below:
clear;clc
a = 1;
b = 8;
c = 15;
By defining your input variables above there is no need to type in numbers to perform your calculations
Use root1 and root2 as the variable names for each root. Also note that placing a semicolon after each line will prevent your command window from being cluttered with calculations. The end of your program should include the following lines
results = [root1 root2];
disp('The roots are displayed below')
disp(results)
The disp commands will display your results.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started