How to use save in matlab function block ?

조회 수: 7 (최근 30일)
kintali narendra
kintali narendra 2023년 9월 15일
댓글: kintali narendra 2023년 9월 15일
In the matlab function block - I used Save function to save few variable into the .mat file. When I ran the simulink, I am getting the following error message.
I am not generating code - I am just trying to run my simulink with matlab function block.

채택된 답변

Fangjun Jiang
Fangjun Jiang 2023년 9월 15일
The MATLAB Function block will be executed at every simulation step, so if save() works, it will create many .mat files, each is likely containing one sample of data at that particular simulation step.
A better way is to make those variables as temporary outputs of the MATLAB Function block, then you can use Simulink data log, To Workspace block, or To File block to save the variables. It will be in better format and easy to process.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Prepare Model Inputs and Outputs에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by