Why do I receive the error "There is no block named..." when adding a MATLAB file (level-2) S-Function to a SIMULINK model using the function ADD_BLOCK?
34 views (last 30 days)
Show older comments
MathWorks Support Team
on 5 Aug 2010
Edited: MathWorks Support Team
on 14 Oct 2022
I receive the following error when adding a MATLAB file (level-2) S-Function to a SIMULINK model using the function ADD_BLOCK:
ERROR: ??? Error using ==> add_block
There is no block named 'simulink/User-Defined Functions/MATLAB file (level-2) S-Function'.
To reproduce this error, you can use the following code:
new_system('mySystem')
open_system('mySystem')
add_block('simulink/User-Defined Functions/MATLAB file (level-2) S-Function', 'mySystem/mySFunction')
Accepted Answer
MathWorks Support Team
on 14 Oct 2022
Edited: MathWorks Support Team
on 14 Oct 2022
To work around this issue, add the block as shown below:
add_block('built-in/M-S-Function', 'mySystem/test')
The following URL links to a description of how to add blocks to a model using the add_block function with the block's 'Blocktype' property.
0 Comments
More Answers (0)
See Also
Categories
Find more on Block Libraries in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!