Borrar filtros
Borrar filtros

Set parameter of Simulink

6 visualizaciones (últimos 30 días)
Antonio
Antonio el 22 de Oct. de 2012
Hi. I have created an '*.m' file with a string which calls a simulink file:
Temperature= sim('TRT_tuning','SrcWorkspace','Current','stoptime','359');
Now, I'd like to set the stoptime, i.e. '359', from the workspace (like the command 'input'). How Can I do this? Thanking you for your attention, I'm looking forward for your answers.

Respuestas (2)

Azzi Abdelmalek
Azzi Abdelmalek el 22 de Oct. de 2012
Editada: Azzi Abdelmalek el 22 de Oct. de 2012
set_param('TRT_tuning','stop time','359')
or
stime=359
set_param('TRT_tuning','stop time',num2str(stime))

Kaustubha Govind
Kaustubha Govind el 22 de Oct. de 2012
You could probably use a model callback function like PostLoadFcn or InitFcn to call any MATLAB code (like INPUT) to get the value from user input and use SET_PARAM with that value.

Categorías

Más información sobre Programmatic Model Editing en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by