Filter löschen
Filter löschen

building simulink model from command window

2 Ansichten (letzte 30 Tage)
Vanja
Vanja am 7 Feb. 2015
Beantwortet: Jason Moore am 7 Feb. 2015
Hello World!
I am trying to build a model via command window.
In this task I have a problem with the next command; add_block('built-in/ToWorkspace', 'untitled/name1', 'Position',[0 0 30 30]), because it changes the default block parameter "Limit data points to last:" from "inf" to 1000. Why is that?
Is there a command to change this parameter to "inf"? I've been looking for a solution but I cannon even find the parameter name, so that I could change it with the "set_param" command..
Thank You!

Akzeptierte Antwort

Jason Moore
Jason Moore am 7 Feb. 2015
To programmatically change the a block parameter you can use get_param and set_param to change parameters of Simulink blocks. The parameter you are looking for is MaxDataPoints. The following commands should get you what you are looking for.
block_handle = add_block('built-in/ToWorkspace', 'untitled/name1', 'Position',[0 0 30 30])
set_param(block_handle,'MaxDataPoints','inf')
Another helpful tip is after you add the block you have an optional output that would be the block handle. I used this handle with set_param to change the desired parameter. You can also pass this handle to the command inspect to see a list of changeable parameters
inspect(block_handle)

Weitere Antworten (0)

Kategorien

Mehr zu Programmatic Model Editing finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by