INFO:
Learn how to create and use MATLAB Functions.
How to Create a MATLAB Function - MATLAB