Hi Alvins,
As per my understanding, you are trying to generate C code from Simulink model which involves ‘MATLAB function’ block, and you want to change the size and type of the input parameters without modifying the source file.
To change the input parameters without modifying source files, you can follow this:
- Define parameters in the MATLAB workspace and reference them using the “Model Explorer”, you can also change types and size of existing parameters.
- In the configuration property window, use ‘tunable’ parameters, which allows you to change the values without altering source code.
Simulink Coder works almost like MATLAB coder just that it has been optimized to generate code from Simulink models, Simulink coder is often used to generate code for embedded systems, regarding dynamic libraries you can configure the build settings to output a dynamic library by using the ‘Interface’ tab under ‘code generation’.
Kindly refer to the documentations below for more information.
Model Explorer:
Generate C Code by Using Simulink Coder Quick Start Tool:
Hope this helps!