Question: complete the code: function project _ 4 ( ) % PROJECT _ 4 project _ 4 ( ) calculates the resultant force acting at a
complete the code:
function project
PROJECT projectcalculates the resultant force acting at a point.
All multiplications, divisions, and exponentiations must use the
dot operator.
All code should be tabbed in once as the template shows and aligned
Name:
Date:
CMPSC
Header Information
fprintfName: s
'Your name';
fprintfClass:CMPSC
;
fprintfDate: s
'date';
fprintf
Description of the program
fprintf;
fprintf
Have the user enter the three forces that are acting on the beam
and the angle for each one
that each one makes the first one is done
F inputEnter the first force: ;
A inputEnter the angle at which the force acts on the beam: ;
You now have to repeat this for F with angle B and F with angle C
Decompose each force into its x and y direction components
There will be six calculatons two for each force
As an example
Fx F cosdA
Add the three x direction forces this sum is the resultant in
the x direction call the variable FRx
Add the three y direction forces this sum is the resultant in
the y direction call the variable FRy
Calculate the resultant force using the appropriate formula Call
this variable FR
Calculate the angle of the resultant force using the inverse
tangent atand this is D
Print the results using fprintf so that the data is formatted to two
decimal places and are aligned on their decimal points
This will include the entered force and the angle, and the x and y
components for the force
Print so that the first force is on the first row, the second force
is on the second row and the third force is on the third
The resultant force will be printed on the fourth row
end
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
