Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions