Question: Finding roots of an equation using roots 0 solutions submitted ( max: 1 ) Write a MATLAB script to find all the roots of the
Finding roots of an equation using roots
solutions submitted max:
Write a MATLAB script to find all the roots of the following equation using the roots function in MATLAB.
For reference about finding roots of equations using the fzero, refer to slides of Module
The information about forloop and whileloop were covered in ModuleA
Script
Here, write your script for the problem statemenet above. Your script MUST be properly and completely commented to receive full credit.
Define variables and functions as instructed below.
The variable to store the coefficients of the polynomial must be called P
Store the roots of the equation in an array called EqnRoo.
After the solution is completed, print out the roots using the fprintf command in the following format:
Root :tabnext line
Note that MATLAB is casesensitive Variables MUST be defined as instructed above, or points will be deeducted.
For this exercise, you need a forloop and a whileloop nested in each other.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
