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

Problem #3 for loop to sum the moments 1-D problem In statics, the sum of moment

ID: 2084614 • Letter: P

Question

Problem #3 for loop to sum the moments 1-D problem

In statics, the sum of moments applied on an object must be zero where the ith moment is defined as:

mi = Fidi         

Where Fi is the ith force, di  is the distance from the center of gravity and mi  the ith moment caused by Fi. For the body to be stable:

                    F1d1 + F2d2 +...+FNdN =0

Write a program in MATLAB that will take the number of forces as input. Then it will go through a for loop for each force. In the for loop it will ask the value of the force , the distance from the center of gravity . Then it will iteratively calculate it corresponding moment  and add it to the sum_moment. Once the for loop is exited, display the sum using disp command.

Submit the script as .m file

Explanation / Answer

While you writing a simple program in Matlab the best way to ensure that the value a user is inputting is a proper integer. or using such comparison and logical operation in the program Like....

when we want to repeat the same process so we using While and For loop.

The syntax by using the For loop.

mi = 0>=10

Fi= ~interger;

di=~interger;

i=[1.2.3.4.5.6.7.8.9.10];

sum=0;

for i=1:length(n)

(~m1)=(~F1*~d1)

end

for(~m2)=(~F2*~d2)

end;

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