automatic change a block number in a mask, coming from simulink library, when I drag it more than onetime in my working space

1 visualización (últimos 30 días)
Hi any dear,
I have simulated a dynamic ball mill model in simulink. the name of a block in ball mill mask is "ballmill_number", I want to change this block number automatically when I drag More than one of this mask in working space. How can I do it?
Thank you so much

Respuesta aceptada

Kaustubha Govind
Kaustubha Govind el 8 de Jul. de 2013
You can typically perform operations on block copy using the CopyFcn callback of the block. See Block Callbacks.
  4 comentarios
Ted
Ted el 11 de Jul. de 2013
Editada: Ted el 11 de Jul. de 2013
Thanks dear, I want to design a software that user can use the mask in his working file, more than one time arbitrary, my software should recognize number of the mask in working place, and calls ever mask with a number. I don't know how to write this code into the callback, it's simple but cant write it, would you please help me to write it?
(excuse me,I can't write English well)
Kaustubha Govind
Kaustubha Govind el 11 de Jul. de 2013
Ted: Sorry, this forum is meant to help with specific questions. Writing entire pieces of code is beyond the scope of our involvement here. I would recommend that you spend more time studying the Simulink command-line API and post when you run into specific issues.

Iniciar sesión para comentar.

Más respuestas (1)

Guru
Guru el 7 de Jul. de 2013
Are you referring to the block name of a block within a masked subsystem that you want to change the name of?
If so, no you cannot do this, but really the question I suppose is why would you want to change the name of the block within a masked subsystem when you have multiple copies in the model?
Simulink changes or adds a block number to blocks, because its requirement is that every block at a certain hierarchical level of Simulink needs to have a unique block name. The block name is only used as a means to identify the block which is mainly just used with the MATLAB API to Simulink.

Categorías

Más información sobre Author Block Masks en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by