Question: matlab code Assignment Description: A sled is being pushed with a constant force of f=50 N (Newtons). The total mass of the rider and the
matlab codeAssignment Description: A sled is being pushed with a constant force of f=50 N (Newtons). The total mass of the rider and the sled is m=80 kg (kilograms). Neglecting any other forces, from Newton's law the acceleration can be determined from a = f/m. The distance d that the sled will travel is given by: where a is the acceleration calculated from Newton's law and t is the time (assuming the sled starts from rest a t0). You are to write a script that will perform calculations and output results as described below. . The script should: Prompt the user for the maximum time (tmax) in seconds Print a nicely formatted message to the command window that says 'Generating 100 points from 0 to x.x seconds' (x.x represents the value of tmax) Create 100 points in time linearly spaced between 0 and tmax Create a variable for acceleration and calculate the value from a = f/m (units are m/s) Calculate a vector of distance values corresponding to the vector of time values Plot distance as a function of time with a green line Label the x-axis 'Time' with units of s (s for seconds) Label the y-axis 'Distance with units of m (m for meters) Title the plot "Sled distance with constant acceleration' . . Note: tmax=25 seconds would be a good value to use when checking the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
