Create Functions in Files - MATLAB & Simulink - MathWorks This example shows how to create a function in a program file.
User-Defined Functions - MATLAB & Simulink - MathWorks Blocks that support custom functions, such as Fcn and MATLAB Function.