Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. return_value is the only data that gets passed back to the main code.
  2. You do not need to have a function description but it is good programming practice to add a comment on each function that describes what the function does. Also, if you add a description of the function, MATLAB will be able to index it and return a description of your function if you type help function_name in the Command Window.
  3. Once you have created a function you MUST name the .m file with the same name the function has. Otherwise MATLAB will not be able to access your function when you call it.
  4. You need brackets around your outputs if you have multiple output arguments. For only one output, the convention is to not include brackets. 

We will start by creating the bending stress function that outputs σx given (M, ri, ro ). 

...