Borrar filtros
Borrar filtros

How can I add a Counter block by M file script ?

2 visualizaciones (últimos 30 días)
Abhijit Chougule
Abhijit Chougule el 28 de Dic. de 2013
Respondida: Abhijit Chougule el 30 de Dic. de 2013
How can I add a Counter block by M file script ? What should be its source path ? I am getting error that There is no block even it is in Library.
I used a command as here
add_block('Signal Processing Blockset/Signal Management/Switches and Counters', 'mysys/cntr5')
and error is
??? There is no block named 'Signal Processing Blockset/Signal Management/Switches and Counters'.
Even this block is there.
Please give me suggestions.

Respuesta aceptada

Jacob Halbrooks
Jacob Halbrooks el 30 de Dic. de 2013
To find the source address of a block to use with add_block, first browse the Simulink Library Browser to get to your block. For example, for the Counter block I browsed to DSP System Toolbox->Signal Management->Switches and Counters. Right-click the library in the browser and select to open it. In the new window, select the desired block, and then execute "gcb" in MATLAB to get its address. For the Coutner block, this produced "dspswit3/Counter", so then you can use a command like this to add it to a model named untitled:
add_block('dspswit3/Counter','untitled/mycounter');

Más respuestas (1)

Abhijit Chougule
Abhijit Chougule el 30 de Dic. de 2013
Ya it's working !!!!
Thank you....

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by