Programming and Data Types    

Kinds of M-Files

There are two kinds of M-files.

Script M-Files
Function M-Files

Do not accept input arguments or return output arguments

Can accept input arguments and return output arguments

Operate on data in the workspace

Internal variables are local to the function by default

Useful for automating a series of steps you need to perform many times

Useful for extending the MATLAB language for your application


  MATLAB Programming: A Quick Start What's in an M-File?