Question
In Matlab: At the initial velocity vo, the object thrown vertically and the height h is reached at time t, where h = vo *
In Matlab:
At the initial velocity vo, the object thrown vertically and the height h is reached at time t, where h = vo * t 0.5 * g *t^2. The program can be written to calculate the time t required to reach a specified height h; for a given value of vo. The input to this function should be h, vo, and g. Test your function with the conditions h = 120m, vo = 50 m/s, and g = 9.81 m/s2. Interpret both answers.
This code (below) was given as the answer, but I can't seem to make it work for me. Can someone explain to me what is missing or what I'm doing wrong. It shows "Error: Function definitions are not permitted in this context." Can someone explain what this means.
code:
function[t] = time1(h,v,g)
syms t1;
a= solve(v*t1-0.5*g*t1^2-h, t1)
t=a
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started