How to get all block parameters from a simulink block?

6 vues (au cours des 30 derniers jours)
Jack Kershaw
Jack Kershaw le 7 Oct 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?

Réponses (1)

Fangjun Jiang
Fangjun Jiang le 7 Oct 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.

Catégories

En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by