6 Functions A function is a self-contained block of code that performs a coherent task of some kind.
Functions are good things.
Functions make code neater every time you want to do that task you simply call that function. When you send a task to a function, you give the function all the variables it needs to know, and it returns the variables that you want. The calculations within the function are hidden. We are going to turn Squares.m into a function. Save As and save it as fSquares.