Difference between revisions of "Creating a block in Simulink"

From OpenMBD
Jump to: navigation, search
Line 19: Line 19:
 
*Change the block to a convenient size
 
*Change the block to a convenient size
 
<br>
 
<br>
At this point, the block has been created successfully. By double-clicking the block, the user settable parameters are shown:
+
At this point, the block has been created successfully. By double-clicking the block, the user settable parameters are shown:<br>
 
[[File:new_block_parameters.PNG]]
 
[[File:new_block_parameters.PNG]]

Revision as of 15:21, 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

  • Click OK
  • Change the block to a convenient size


At this point, the block has been created successfully. By double-clicking the block, the user settable parameters are shown:
New block parameters.PNG