Setting variable values in workspace for simulating model in command window.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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.
0 Kommentare
Antworten (1)
Kaustubha Govind
am 7 Jul. 2011
It looks like #1 has already been answered on your previous question: http://www.mathworks.com/matlabcentral/answers/11069-simulating-model-in-command-window-without-using-workspace
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.
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!