On Simulink how to add_block with output data type boolean?

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 comentario

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?

Iniciar sesión para comentar.

Respuestas (1)

Yao Li
Yao Li el 14 de Mayo de 2013
Editada: Yao Li el 14 de Mayo de 2013
add_block('built-in/Constant','test/const1','Position',[90 20 110 40],'OutDataTypeStr','boolean','Value','1');

5 comentarios

Uugan
Uugan el 14 de Mayo de 2013
??? Error using ==> add_block
Constant block does not have a parameter named 'OutDataTypeStr'.
I tired the above codes with Matlab 2013a, and it works well. what's your version?
Uugan
Uugan el 14 de Mayo de 2013
Editada: Uugan el 14 de Mayo de 2013
7.0.1.24704
uh, earlier version. I may have a try after work when I'm at home.
Hi Uugan, I only have 2008b and the above codes also work well with that version. sorry.

Iniciar sesión para comentar.

Categorías

Más información sobre Modeling en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 14 de Mayo de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by