Difference between revisions of "Creating a block in Simulink"

From OpenMBD
Jump to: navigation, search
Line 3: Line 3:
 
*Drag-and-drop a Level-2 MATLAB S-Function into the project
 
*Drag-and-drop a Level-2 MATLAB S-Function into the project
 
[[File:level_2_matlab_s_function.PNG]]
 
[[File:level_2_matlab_s_function.PNG]]
* Right-click the block
+
*Right-click the block
 +
*Select Mask -> Create Mask...
 +
*carefully copy the settings depicted in the following images:
 +
[[File:icon_and_ports.PNG]]
 +
[[File:parameters_and_dialog_channel.PNG]]
 +
[[File:parameters_and_dialog_tsamp.PNG]]
 +
[[File:initialization.PNG]]
 +
[[File:documentation.PNG]]
 +
*Click OK
 +
*Right-click the block
 
*Select Block Parameters (M-S-Function)
 
*Select Block Parameters (M-S-Function)
 
*Fill in the parameters as follows:
 
*Fill in the parameters as follows:
 
[[File:level_2_matlab_s_function_parameters.png]]
 
[[File:level_2_matlab_s_function_parameters.png]]
 
*Close the dialog
 
*Close the dialog

Revision as of 15:00, 28 February 2019

With all files in place, a new block can be created.

  • Open the Simulink Library Browser
  • Drag-and-drop a Level-2 MATLAB S-Function into the project

Level 2 matlab s function.PNG

  • Right-click the block
  • Select Mask -> Create Mask...
  • carefully copy the settings depicted in the following images:

Icon and ports.PNG Parameters and dialog channel.PNG Parameters and dialog tsamp.PNG Initialization.PNG Documentation.PNG

  • Click OK
  • Right-click the block
  • Select Block Parameters (M-S-Function)
  • Fill in the parameters as follows:

Level 2 matlab s function parameters.png

  • Close the dialog