From the figure we have
.......Eq.1
.......Eq.2
From Eq.1 and Eq.2
......Eq.3
where
are constants given by
We need to solve the above equation (Eq.3) using MATLAB to find
the solution for
The MATLAB code to obtain the value of is shown below.
%cleaning the workspace
clear all
%clearing the command window
clc
%Prompting the user to enter the values of b1,c1,c2,A1 and A2
b1=input('Enter the length of b1 in meters:');
c1=input('Enter the length of c1 in meters:');
c2=input('Enter the length of c2 in meters:');
A1=input('Enter the angle A1 in degrees:');
A2=input('Enter the angle A2 in degrees:');
%calculating the constants k1 and k2
k1=-2*c2*cos(A2*pi/180);
k2=c2^2-b1^2-c1^2+2*b1*c1*cos(A1*pi/180);
%obtaining the roots of b2^2+k1*b2+k2=0
r=roots([1 k1 k2]);
%assiging the positive roots of the above equation to b2 which is
the real
%solution
b2=r(r>0);
%displaying the length of b2 on the command window.
fprintf('The length of b2 is %4.4f m\n',b2)
The output on the command window for the test case inputs is
Enter the length of b1 in meters:140
Enter the length of c1 in meters:120
Enter the length of c2 in meters:100
Enter the angle A1 in degrees:110
Enter the angle A2 in degrees:130
The length of b2 is 134.7781 m
Label not Mi published script file your results (units) and plots accordingly. Answer with comple...
Please answer 1c, use MATLAB, and paste your entire script in
your answer so that I can copy and paste to see if it works.
Problem #1 400g triangle square pentagon hexagon Figure 1 For a closed geometric figure composed of straight lines (Figure 1), the interior angles in the figure must add to (n-2)(180) where n is the number of sides. Required Tasks a) Write a script that prompts the user to select from one of the following shapes:...