Main Content

Author Blocks Using MATLAB

Use MATLAB® code within specialized APIs to author blocks

Author block algorithms using MATLAB code:

  • If your model does not require states or has discrete states retained for a single time step, use MATLAB Function block.

  • If your model has continuous states or discrete states with multirate input and output ports, use the Level 2 MATLAB S-Function. This workflow does not support bus input and output ports and might require manually creating a Target Language Compiler (TLC) for code generation.

  • If your model has discrete states and you want to generate code without a TLC file, use the MATLAB System block. This block allows you to effectively process large streaming data.