How to use save in matlab function block ?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
kintali narendra
am 15 Sep. 2023
Kommentiert: kintali narendra
am 15 Sep. 2023
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1483166/image.png)
I am not generating code - I am just trying to run my simulink with matlab function block.
0 Kommentare
Akzeptierte Antwort
Fangjun Jiang
am 15 Sep. 2023
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Prepare Model Inputs and Outputs finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!