Modifying discrete filter block simulink

1 vue (au cours des 30 derniers jours)
Adam Keller
Adam Keller le 20 Mai 2015
Commenté : Nobel Mondal le 20 Mai 2015
I am having issues modifying the discrete filter block, I would like to reproduce the same block, except be able to change the sampling rate of the filter with an an input. Is there any way to: a) See the block in code format b) reproduce the discrete filter in block format. Thanks in advance.

Réponse acceptée

Nobel Mondal
Nobel Mondal le 20 Mai 2015
Modifié(e) : Nobel Mondal le 20 Mai 2015
Hi Adam,
If you're trying to modify the sample time from the command prompt, this api might be helpful:
>> load_system('myMdl');
>> set_param('myMdl/Discrete Filter', 'SampleTime', '0.1');
To create an identical twin block, this could be used:
>> add_block('myMdl/Old_block_name', 'myMdl/Twin_block_name');
Hope this helps, Nobel.
  1 commentaire
Nobel Mondal
Nobel Mondal le 20 Mai 2015
Some fancy staff :)
Duplicating the block would might overlay them on top of each other. To avoid that:
>> old_pos = get_param('myMdl/Old_block_name', 'Position');
>> add_block('myMdl/Old_block_name', 'myMdl/Twin_block_name');
>> set_param('myMdl/Twin_block_name', 'Position', old_pos + [100 0 100 0]);

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Simulink dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by