in matlab Change the variable t to represent 5 seconds Given
(in matlab)
Change the variable t to represent 5 seconds.
Given h=1/2*g*t^2, how much is h now?
Solution
>> t=5;
>>g=9.8; (g is referred to as the acceleration of gravity. Its value is 9.8 m/s2 on Earth)
>> h=(1/2)*g*power(t,2)
h =
122.5000
or you can use input command to enter manual values for t
like
t=input(\'enter time value\');
>> g=9.8; (g is referred to as the acceleration of gravity. Its value is 9.8 m/s2 on Earth)
>> h=(1/2)*g*power(t,2)
