How can I edit the Simulink To Workspace block from a .m file?

Specifically, I am looking to change the 'Limit data points to last:' from 1000 to inf automatically. I have used the set_param function to edit other parameters (such as Variable name and Sample time) however when I try the same format for changing the limit I get an error. The function call I use is: >> set_param('Filename/ToWorkspace','Limitdatapointstolast','inf'); And I get the following error: ToWorkspace block does not have a parameter named 'Limitdatapointstolast'
However functions calls like the one below work. >> set_param('Filename/ToWorksapce','Variablename','Dataout');
Any help is appreciated!

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 11 月 29 日
編集済み: Azzi Abdelmalek 2012 年 11 月 29 日

0 投票

set_param('Filename/ToWorksapce','MaxDataPoints','100')
If you want to get your block parameters names
get_param('Filename/ToWorksapce','dialogparameters')

1 件のコメント

Ken
Ken 2012 年 12 月 3 日
Exacly what I was looking for! Thanks!

サインインしてコメントする。

その他の回答 (1 件)

Vishal Rane
Vishal Rane 2012 年 11 月 30 日

0 投票

blk_prop_struct = get(get_param('blk_path','Object'));
OR
blk_prop_struct = get(blk_handle);
gives you most of the block properties and their current values. Explore them for the properties you need.

カテゴリ

ヘルプ センター および File ExchangeProgrammatic Model Editing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by