MATLAB Function blocks provide the following capabilities:
Allow you to build MATLAB® functions into embeddable applications — MATLAB Function blocks support a subset of MATLAB toolbox functions that generate efficient C/C++ code. For information see Functions and Objects Supported for C/C++ Code Generation — Alphabetical List.. With this support, you can use Simulink® Coder™ to generate embeddable C code from MATLAB Function blocks that implement a variety of sophisticated mathematical applications. In this way, you can build executables that harness MATLAB functionality, but run outside the MATLAB environment.
Inherit properties from Simulink input and output signals — By default, both the size and type of input and output signals to a MATLAB Function block are inherited from Simulink signals. You can also choose to specify the size and type of inputs and outputs explicitly in the Ports and Data Manager (see Ports and Data Manager) or in the Model Explorer (see Search and Edit Using Model Explorer).