Can someone write this in code. From the application called MatLab. Recitation P
ID: 2267324 • Letter: C
Question
Can someone write this in code. From the application called MatLab.
Recitation Problem 2.2: a MATLAB script to determine the smallest positive root of the function x2|cos(G)-5 (x is in radians) using the false-position method. Perform the computation until the relative approximate error falls below 1%. To locate the region in which the root lies, so as to determine the initial guess, first plot this function for values of x between 0 and 5. Check your final answer by substituting it into the original function.Explanation / Answer
Uf = roots(x^2 + |cos( x)|=5);
i = 1;
j = 0;
while i<=length(Uf);
notcomplex = isreal(Uf(i,1));
if notcomplex == 1 && Uf(i,1)>=0;
Ufl = Uf(i,1);
if Ufl < j;
U_flutter = Ufl;
else
j = Ufl;
end
else
if Uf(i,1)>0
U_flutter = j;
end
end
i = i + 1;
end
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.