User-defined function error: V is undefined

  • Context: MATLAB 
  • Thread starter Thread starter qiyan31
  • Start date Start date
  • Tags Tags
    Function Matlab
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
qiyan31
Messages
3
Reaction score
0
I made a user-defined function for Height.
function Ht=Height(t,V,Theta);
Ht=V*t*sin(Theta)-4.9*t.^2;
end

V is initial velocity, and i kept on getting input "V" is undefined.
Can someone help me please!
 
Physics news on Phys.org
Works fine for me. What is the precise command that you're using to test the function?