Question: Write a MATLAB function that calculates Vx, Vy and KE (Kinetic Energy). This function takes an input argument mass m and returns an output argument

 Write a MATLAB function that calculates Vx, Vy and KE (Kinetic

Write a MATLAB function that calculates Vx, Vy and KE (Kinetic Energy). This function takes an input argument mass m and returns an output argument body that is a 1xn structure array, body contains fields; mass, time, Vx, Vy and KE. Ask the user to enter a value for duration of the experiment tmax between 0 and 5. If the value entered by the user is not in the range, display an error message and terminate the program. Otherwise, create a t vector from 0 to tmax with the time steps tmax/10. Store t vector also in the field of body. Calculate Vx, Vy and KE then store them in the fields of body. This function must allow user to enter either a scalar value or a vector for mass m. Use only for loop for this question. (Note: Use Vx and Vy equations you found in Q1a (with m = 1 kg) for different m values.) Write a MATLAB function that calculates Vx, Vy and KE (Kinetic Energy). This function takes an input argument mass m and returns an output argument body that is a 5xn cell array. Rows of body contains; mass, time, Vx, Vy and KE values respectively. Ask the user to enter a value for duration of the experiment tmax between 0 and 5. If the value entered by the user is not in the range, display an error message and terminate the program. Otherwise, create a t vector from 0 to tmax with the time steps tmax/10. Store t vector also in the cell of body. Calculate Vx, Vy and KE then store them in the cells of body. This function must allow user to enter either a scalar value or a vector for mass m. Use only while loop for this question. (Note: Use Vx and Vy equations you found in Q1a (with m = 1 kg) for different m values.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!