0

so i created a function

function output = height (t)

output = (-9.8./2).*t.^2 + 125 *t + 500;

height (0:0.5:30)

I saved the file in the matlab directory for where it's saved, and

4
  • Is this three lines saved in one file? In this case, last line will be part of function. Commented Apr 26, 2013 at 12:06
  • 3
    What is the question? Commented Apr 26, 2013 at 12:08
  • @ Danil Asotsky thanks man exactly what the problem was, cheers to the others as well Commented Apr 26, 2013 at 13:12
  • To whoever has a related question, basically for the test. You create a new script file to generate your function, then save it and close it. It will be stored and ready to use in its functional form within your original script file with answers. Also Danil, i would really like to give you reputation but i seem to not know how to from the comment section. Commented Apr 26, 2013 at 13:34

1 Answer 1

1

Try this, in a single file Editor, save and 'run/launch':

function main()

 height(0:.1:30)

end


function out = height (t)

 out = (-9.8./2).*t.^2 + 125.*t + 500;  

end
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.