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
0 solutions submitted (max: 1)
Write a MATLAB script to find all the roots of the following equation using the roots function in MATLAB.
f(x)=x3-3x2+3
For reference about finding roots of equations using the fzero, refer to slides 32-33 of Module_02.
The information about for-loop and while-loop were covered in Module_01A.
Script ?8
% 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 Eqn_Roo.
% After the solution is completed, print out the roots using the fprintf command in the following format:
% Root 1.0:{tab}12.3456{next line}
% Note that MATLAB is case-sensitive. Variables MUST be defined as instructed above, or points will be deeducted.
% For this exercise, you need a for-loop and a while-loop nested in each other.
Finding roots of an equation using roots 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!