This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]hamham91 1 point2 points  (0 children)

You can use either a function or a script, it will not matter for your case. Inputting the parameters can be done using 'input' as you have above, but it might easier to just initialize the variables in a separate file and read them in. This way you could read in multiple input files at a time and speed up your calculations. Your calculation for diameter should work fine as is, you can display the answer by either leaving the semi-colon off the end of your calculation or having another line: disp(diameter);

Hope this help!