MATLAB: How to edit the Simulink To Workspace block from a .m file

dialogparametersget_paramset_paramsimulink

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!

Best Answer

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