Clear Filters
Clear Filters

On Simulink how to add_block with output data type boolean?

11 views (last 30 days)
For example:
add_block('built-in/Constant','test/const1','Position',[90 20 110 40],'OutDataType','boolean','Value','1');% 0 or 1
Here on simulink shows constant block with output data type = Inherit from 'Constant value' but I need boolean output. How to do it without changing value as true or false?
  1 Comment
Kaustubha Govind
Kaustubha Govind on 14 May 2013
You can see the list of parameters of the Constant block using the following command:
get_param('built-in/Constant', 'DialogParameters')
What is the list of parameters in your version?

Sign in to comment.

Answers (1)

Yao Li
Yao Li on 14 May 2013
Edited: Yao Li on 14 May 2013
add_block('built-in/Constant','test/const1','Position',[90 20 110 40],'OutDataTypeStr','boolean','Value','1');
  5 Comments
Yao Li
Yao Li on 14 May 2013
uh, earlier version. I may have a try after work when I'm at home.
Yao Li
Yao Li on 14 May 2013
Hi Uugan, I only have 2008b and the above codes also work well with that version. sorry.

Sign in to comment.

Categories

Find more on Simulink Functions in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!