Borrar filtros
Borrar filtros

Setting variable values in workspace for simulating model in command window.

2 visualizaciones (últimos 30 días)
1. Ineed to know the variable names used in the model(.mdl) file using command. 2. If i know the variable names used in the model, then how to set the variable values in the workspace so that the sim() method is used to simulate the model.
3. How to get the output of the simulation.
Please help.

Respuestas (1)

Kaustubha Govind
Kaustubha Govind el 7 de Jul. de 2011
Once you have found all the variables needed by the model, you can use the assignin command to create the variable in the base workspace. When you run the SIM command, it looks for the variables in the base workspace by default. Note that any logged signals will also be created in the base-workspace by default.
Alternatively, if you'd like the model to look for and log the variables in the workspace of the function that you are calling SIM from (without littering the base workspace), you can use the SrcWorkspace and DstWorkspace options (as described here).
See Single-Output Syntax for the sim Command for help on getting all the outputs packed into a single structure.

Categorías

Más información sobre Event Functions en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by