I have to use the while loop to write a function that will ask for a given height of an object and return the time it takes for the object to reach that height given that h=t+5*sin(t), with a time increment of 0.001, and it has to output "The time for the object to reach a height of (h) is (answer) seconds" so far ive got this:
h= input('input height of object:') ctr = 0; t = 0:0.001:100;while t > 0; t = t + 0.001 h = t + 5*sin(t); ctr = t + 1;endhctr
this is my first programming class and i have zero experience could anyone tell me what im doing wrong? i don't know how to the output expression, but the code i have currently isnt correct.
Best Answer