Add Functions to Scripts - MATLAB & Simulink
www.mathworks.com › help › matlabAdd Functions to Scripts. Starting in R2016b, MATLAB ® scripts, including live scripts, can contain code to define functions. These functions are called local functions. Local functions are useful if you want to reuse code within a script. By adding local functions, you can avoid creating and managing separate function files.