Calculate the Sum of the Interior Angles From the Given Figure Using MATLAB

$19.00$14.001285 reads

Question

In order to have a closed geometric figure composed of straight lines (Shown in figure), the angles in the figure must add to

                                  

                                                          (𝑛−2)(180 𝑑𝑒𝑔𝑟𝑒𝑒𝑠)

Where n is the number of sides.

               Calculate the Sum of the Interior Angles From the Given Figure Using MATLAB                                 

 

a) Write a program that prompts the user to enter one of the following

triangle

square

pentagon

hexagon

Use the input to define the value of n via a switch/case structure;

Then use n to calculate the sum of the interior angles in the figure.

b) Reformulate your program from part (b) so that it uses a menu.

 

Summary

This question belongs to MATLAB software and discusses about application of MATLAB in mathematics and to calculate the sum of the interior angles from the given figure.

 

 

 

 

Add to Cart