필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
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.

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2011년 7월 7일
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.

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by