Search code examples
matlabsimulinks-function

Simulink: how to store a local variable in level 2 S-function?


I'm starting from msfuntmpl_basic.m and modifying it to output audio from an audio device.

Where can I store the device (dsp.AudioRecorder)?


Solution

  • The solution seems to be use the 'persistent' attribute for the variable in a function.