height = 60 + 340 t - 4.9025 t 2
where t is the elapsed time in seconds; height is the altitude above the ground in meters.
Generate two arrays: height and t for 0 ? t ? 60, in increments of 3 seconds.
Print the height versus time. Â Â Â Â Modify and use the following for loop to print results:
for ii=1:length(height)
fprintf(
Solution
time = linspace(0,60,21) %linspace is used to generate the equally spaced vector with 3s difference. 21 denotes the number of points required as linspace always includes end points.Since 21 points are generated b/w 1 and 60, they are equally separated by 3 sec each.
height = 60 + 340 time - 4.9025 time 2 %vector opertation is inbuilt in matlab. So this statement generates height vector for all values in time vector
for ii=1:length(height)
fprintf(
.