Question: Please help, if for matlab... Code to call your function: h 1 = 1 ; e = 0 . 7 ; [ TotalDist , BounceOut,z
Please help, if for matlab...
Code to call your function:
h;
e ;
TotalDistBounceOut,z BallBouncehe
Thank you for code, still not working....
function totaldistance, numbouncesrequired, distances BallBounceh e
Compute total distance traveled
totaldistance h e e;
Initialize variables
distance h;
numbounces ;
distances ;
Iterate until the condition is met
while distance totaldistance
Update distance traveled and number of bounces
distance distance e distance;
numbounces numbounces ;
Store distance in the vector
distances distances distance;
end
Store the last distance in the vector
distances distances distance;
Output the total distance and number of bounces required
numbouncesrequired numbounces;
end
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
