Question
Matlab Intro to User-Defined Functions 1. Download the quadratic.m file from Canvas and make sure the file is in today's directory. **quadratic.m file: function [root1,
Matlab Intro to User-Defined Functions
1. Download the quadratic.m file from Canvas and make sure the file is in today's directory.
**quadratic.m file:
function [root1, root2] = quadratic(a, b, c) % [root1, root2] = quadratic(a, b, c) % Solves the roots of a quadratic expression using the known coefficeints % a*x^2 + b*x + c % a, b, and c are the inputs to this function and the two roots are the % output
root1 = (-b + sqrt(b.^2 - 4.*a.*c))./(2.*a); root2 = (-b - sqrt(b.^2 - 4.*a.*c))./(2.*a);
end
**
2. Solve for the roots of the following polynomials:
A. x2 + 4x + 2
B. 3x2 + 2x
C. 2x2 + 4
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