필터 지우기
필터 지우기

Can I use "To File" block inside Matlab Function in the form of a command?

조회 수: 1 (최근 30일)
Ehtisham ul Hasan
Ehtisham ul Hasan 2022년 9월 20일
답변: Geetla Sindhu 2022년 10월 4일
Can I use a command for To File inside Matlab Function instead of using To File block to send data of variables in Matlab Workspace from Simulink?
Please note that the robot I am controlling from Simulink has its own library blocks and I can only send data from this Simuilink model to Matlab Workspace using To File block. To Workspace block is not supported and neither I can save the workspace from the Figure.
Since I have a lot of variables inside a Matlab Function and I already have a lot of blocks, I dont want to flood my model with alot more. Would appreciate help in this regard.
Thank you.
Best Regards

답변 (1개)

Geetla Sindhu
Geetla Sindhu 2022년 10월 4일
Hello Ehtisham,
I understand that you are using a MATLAB function and wanted to save the data to a .mat file but without using the “To File” block.
A possible workaround to avoid using the 'To File' block could be:
  • To log the signal that you want to save by right clicking on the signal >> Properties >> Log signal data.
  • Then use a 'save' command in the StopFcn Model Callback in the Model Properties of the Modeling Tab to store the data to a MAT file.
Please refer to the documentation given below for further information:

카테고리

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

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by