Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write code in MatLAB. Thanks Updated The following code was written to solve the

ID: 3844100 • Letter: W

Question

Write code in MatLAB. Thanks

Updated

The following code was written to solve the problem of: Create a script file that asks a user for inputs of three sides to a triangle, and then calculates the three interior angles using the Law of Cosines, to find the angle opposite the largest side(c) and Law of Sines to find the second angle, and the sum of angles to find the third angle. Law of Cosines: c^2 = a^2 + b^2 - 2ab cos(angle C) Law of Sines: sin(angleA)/a = sin(angleB)/b = sin(angleC)/c Triangles Interior angles. angleA + angleB + angleC = 180 degree The numbers next to the commands are the line numbers that would appear in the Editor window and should be used to address the locations of the errors. 2 points will be awarded for each error which is called out with its proper fix, up to 10 errors. In the solution, state the line there error is and what you would type in to fix the line. i.e., Line 1 What command you think it should be entered on this line

Explanation / Answer

A = input('Enter length of side A');
B = input('Enter length of side B');
C = input('Enter length of side C');

c_deg = acosd((A^2 + B^2 - C^2)/(2*A*B))
b_deg = asind(sind(c_deg)*B/C)
a_deg = asind(sind(c_deg)*A/C)

c_deg + b_deg + a_deg %will be 180 hence correct

fprintf("angleA = %d angleB = %d angleC = %d ",a_deg,b_deg,c_deg);

I hope you like the answer :)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote