Borrar filtros
Borrar filtros

Calling Simulink model in a function

33 visualizaciones (últimos 30 días)
Michael
Michael el 24 de En. de 2014
Respondida: Kaustubha Govind el 27 de Mzo. de 2014
Hello,
I have a Simulink model using the variable V in a gain block. I want to perform a parameter analysis and therefor have to start the simulation several times with the command sim.
This works fine if I do this in the command window or using a script.
If I call sim in a function, and the parameter V for the model is an argument of the function, the model will not recognize the variable inside the function. Can someone give me explantion for this behaviour?
Michael

Respuestas (2)

Iain
Iain el 24 de En. de 2014
Simulink uses the base workspace. You can assign the variable in the base workspace using assignin or evalin.
Alternatively, you can set up your model to accept a time series input and supply that from your function.

Kaustubha Govind
Kaustubha Govind el 27 de Mzo. de 2014

Categorías

Más información sobre Simulink Environment Customization 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