필터 지우기
필터 지우기

Simulation data storage- help

조회 수: 1 (최근 30일)
Anuj
Anuj 2013년 12월 10일
답변: Anuj 2013년 12월 13일
Hello, I want to store the steady state value of output signal(as displayed in display block) in mat file and get it displayed in the command window. I am using sim command to run the simulation. When I use the 'to file' block, it stores struct or array of signals, How to store only steady state value, and get it displayed in command window? Alos. how to use mat file?? Please help.
Thanks & Regards- Anuj
  댓글 수: 1
Anuj
Anuj 2013년 12월 12일
It would be great, if I get any suggestion.. Thanks

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

채택된 답변

Anuj
Anuj 2013년 12월 13일
What I did is I used 'to workspace' block instead of 'to file' and stored the variable in array format then var(end) solved my problem.. It was easy :)

추가 답변 (1개)

Ilham Hardy
Ilham Hardy 2013년 12월 12일
Say:
  • Your filename is 'untitled.mat' and located in your current folder
  • Variable name stored is 'var_1'
  • The "To File" block is connected to single input (no Mux)
Solution:
After simulation, run commands below in the Command Window
load untitled
var_1(2:end)
Remarks:
  • You only want to show steady-state value which in this case the last value (simulation time -wise)
  • var_1 is 2xn matrix, the first column contains t_sim and second clumn contains var_1 value
  댓글 수: 4
Anuj
Anuj 2013년 12월 12일
Thanks Again, but still I am not getting my desired output as the variable (as suggested by you - var_1(2:end)) is shown as 1x1 double timeseries in workspace. I want only the final value to be stored and displayed.
Anuj
Anuj 2013년 12월 13일
편집: Anuj 2013년 12월 13일
Thanks IIham for your help, that didnt work effectively.. I got a different way though :) Your answer deserves a vote.

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

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by