Store variable to file in Simulink
Show older comments
Dear MATLAB community,
I am trying to store an array of vector variable to a file in Simulink from a MATLAB function block.
I have tried
(1)'save('savevec.dat', 'vec');'
but function 'save' is not suppoorted as coder.extrinsic.
I have also tried
(2)'matlab.io.saveVariablesToScript('savevec.m', 'vec')'
but Simulink does not seem to be able to detect variable 'vec' in case (2).
I am reluctant to use Simulink's sink 'to file' block, as vec suppose to be internal calculations.
Thanks in advance for your help.
Regards.
Accepted Answer
More Answers (1)
Sean de Wolski
on 15 Sep 2014
0 votes
Why not make vec a second output of the function&block and then use the "To File" block?
1 Comment
Categories
Find more on Event Functions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!