Saving simulation data from SimScape blocks to workspace

조회 수: 3 (최근 30일)
Richard
Richard 2020년 3월 17일
댓글: Fangjun Jiang 2020년 3월 17일
Hello everybody,
I have multiple SimScape models which I call during execution of a Matlab-script. After the simulation of one SimScape-model has terminated, I need to process the results further. So what I need to have is the Simulation-Output as a workspace variable. I do not want to use the "toWorkspace" block because I would have to add a lot of "Temperatur-Sensor-Blocks" to my thermal model, which seems to be unnecessary as explained below. In contrary, I want to use the Data which is automatically generated within a SimScape-Block (e.g. a Thermal Mass Block).
The Data is already written to Workspace and I can access them in the following way:
plot(ans.Temperaturen.Back_Iron.T.series.time,ans.Temperaturen.Back_Iron.T.series.values('degC'),'b');
What is visible from this command: I changed the "workspace variable name" in Simulink -> Model Settings->SimScape->workspace variable name to "Temperaturen".
Nevertheless the data appears in the Workspace as "ans" (and the underlying sections of the structure, e.g. Back_Iron, is not visible"). This causes problems because if I want to access the data of the following Simulation model, I first have to clear the variable "ans".
Does anybody know how I have to change the settings in Simulink so that the Simulation output is only named "Temperaturen" without the "ans"?
Thank you so much in advance for your help!
Edit: grammar, precision of description
  댓글 수: 1
Fangjun Jiang
Fangjun Jiang 2020년 3월 17일
It's strange. The variable in the workspace after the simulation should be "Temperaturen" as you set it. "ans" is the reserved variable name for "most recent answer". Please start from fresh to see what is happening. See example model "sh_cyl_closed_circuit.slx"

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating Custom Components and Libraries에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by