On Simulink how to add_block with output data type boolean?

7 次查看(过去 30 天)
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 个评论
Kaustubha Govind
Kaustubha Govind 2013-5-14
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?

请先登录,再进行评论。

回答(1 个)

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

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by