Question: Matlab 4. Write an anonymous function that will calculate the third side of a triangle using the law of cosines as c = a +
4. Write an anonymous function that will calculate the third side of a triangle using the law of cosines as c = a + b2 - 2ab cos(@) with variables, a, b, and 0 (see help elfun). Set up a for loop that will call the anonymous function with an input vector containing the two legs of a triangle and another input for the angle, e, (in degrees) between the two triangle legs. Using the for loop. specify that a is within the range 4 -20 (inclusive) with increments of 4, b equals a multiplied by 2.5, and e (degrees) equals a multiplied by 10. Output a table (with column headers) including values for a, b, o, and c with 2 digits after the decimal point in columns 10 characters wide. as c 4. Write an anonymous function that will calculate the third side of a triangle using the law of cosines a +6 - 2ab cos(@) with variables, a, b, and (see help elfun). Set up a for loop that will call the anonymous function with an input vector containing the two legs of a triangle and another input for the angle, 0. (in degrees) between the two triangle legs. Using the for loop. specify that a is within the range 4 -20 (inclusive) with increments of 4. b equals a multiplied by 2.5, and 0 (degrees) equals a multiplied by 10. Output a table (with column headers) including values for a, b, o, and c with 2 digits after the decimal point in columns 10 characters wide
Step by Step Solution
There are 3 Steps involved in it
To solve the problem described we need to create an anonymous function in MATLAB to calculate the third side c of a triangle using the Law of Cosines ... View full answer
Get step-by-step solutions from verified subject matter experts
