How to save logged signal to a MAT file without using 'TO WORKSPACE' block ?
조회 수: 4 (최근 30일)
이전 댓글 표시
I have a MATLAB GUI which can be used to run multiple simulations and plot results. The user selects the signals by clicking on the signal (which are selected by the GUI using Signal Logging).
Additionally, I want to save all the user selected signals into a MAT file. Is there a meathod to save the logged signals in SImulink model into a MAT file ?
채택된 답변
Fangjun Jiang
2016년 8월 31일
If it is done through customized GUI, it might depend on the customized GUI.
If it is done through right click the signal line, select "Signal Properties ....", check "Log signal data" and specify a name.
In the model menu "Simulation", "Configuration Parameters ...", "Data Import/Export", check "Signal logging". By default, the signal logging is saved in the variable logsout in the MATLAB workspace. You can then save logsout to a .mat file.
logsout is an object. Use logsout.unpack('all') to unpack the signal logging.
댓글 수: 3
Fangjun Jiang
2016년 8월 31일
I am not aware of a method to save signal logging directly to a .mat file. There is a block called "To File". I doubt that is what you want.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Save Run-Time Data from Simulation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!