Explore BrainMass

Matlab codes

This content was STOLEN from BrainMass.com - View the original, and get the solution, here!

Hello again, I am posting a issues I need help with in matlab that the book does not help period. Again, adult student doing his best to learn everything he can and most efficiently to build my skills beyond these basics. I am trying to incorporate many things from the books that give no examples to learn better.

Please show me in matlab language how to write in code all the following. Thanks as always for believing in my educational goals!

1) Program 1

Using the mfile window the height and distance traveled by a ball thrown at an angle A and with a speed v is: [h(t) =vtsin(A)-0.5gt^2] , [x(t)=vtcos(A)].
Answer the following using v=10m/s and a time step of 0.001 and g=9.81m/s^2.

a) Use a loop, (now this book references using a for loop for one part and a while loop in the other part of this problem and do not know why), to calculate and plot the height versus ime for the angle A=35 degrees. Also, use the max function to find the maximm height reached and the time it takes to reach that height(the corresponding time instant).
b) Polt on the same graph the trajectories (ie plot h versus x) corresponding to three different angles A=20 degrees, 45degrees,and 70 degrees.
c) Using the angle A=30 degrees, plot the trajectories corresponding to three different velocities v=10,20,30m/s, on thre different graphs arranged vertically on the same page using subplot.

© BrainMass Inc. brainmass.com September 23, 2018, 2:25 pm ad1c9bdddf - https://brainmass.com/engineering/electrical-engineering/matlab-codes-95701

Solution Summary

The solution includes Matlab codes.