How to get all block parameters from a simulink block?

15 visualizaciones (últimos 30 días)
Jack Kershaw
Jack Kershaw el 7 de Oct. de 2022
Respondida: Fangjun Jiang el 7 de Oct. de 2022
I am trying to convert a model cointainign TargetLink blocks to there corresponding simulink blocks. Currently I am using:
param = get_param(targetLinkBlock, 'Param');
Then replacing and setting the paramaters of the new block using:
simulinkBlock = replace_block(model, 'Name', block_name, type);
set_param(simulinkBlock, 'Param', param);
Although this does work, it seems a very tedious way to do this, especially as some blocks such as lookup tables have well over 10 parameters.
Is there a better way to do this, by getting and setting all parameters in a single command, or just a simpler way to unlink/mask the target link blocks?

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 7 de Oct. de 2022
Use the function that is provided by TargetLink. I used it before but can't remember the name, something like tl_clear_system()?
TargetLink provides the capability to do Simulink <--> TargetLink conversion both ways, and API too.

Categorías

Más información sobre Subsystems en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by