Hi ! I am currently doing 'real-time audio processing' using simulink and matlab.
Firsly, I built system block for simulink ('record_test.mdl') like this. ( http://www.flickr.com/photos/52197146@N07/7216105684/in/photostream)
Followings are my MATLAB code(.mfile).
(...)
sim('record_test');
(other codes...)
But the process doesn't return from simulink to MATLAB at all.
Is there anyone who can give me some advice? I really appreciate all of your comments.
SIM is blocking, it will return to your script only when the simulation terminates.
If you want to start a simulation from command line in a non-blocking way, you can use:
set_param(modelname,'simulationcommand','start')
That way your script will continue to the next line once the simulation is started, without waiting for it to complete.
2 Comments
Direct link to this comment:
http://www.mathworks.nl/matlabcentral/answers/38770#comment_80201
Do you mean the SIM command hangs your MATLAB script?
Direct link to this comment:
http://www.mathworks.nl/matlabcentral/answers/38770#comment_88712
yes this will happen in SIM when working with real time audeio