To do this, somewhere in your model you need to have a block that maintains the previous values of the sampled input (the convolution window) so that the "MATLAB Function" block (formerly known as the "Embedded MATLAB Function" block) can do the convolution over the entire convolution window.
You have two main options..
- Use one of the built-in blocks to do this. For instance, in basic Simulink there is the Tapped Delay block in the Discrete library. In the DSP System Toolbox library, there are more sophisticated buffer blocks that give you many more options (though it sounds like for some reason you cannot use those). Then, you can pass the output of these blocks to your MATLAB Function block and the input will be a vector that you can then use for the convolution.
- Use persistent variables in the MATLAB Function block to maintain the state of the convolution window within the MATLAB Function block itself. This would require more coding to shift the values of the window manually, but maybe you're into that :)
I'm no signal processing expert, so if someone wants to correct my language a bit then please do :) Also, I know that once you start going from a sampled signal to a more frame-based signal, there are a few of other design choices to consider, such as the window size and what the sample time of the frame-based signal should be.
Hope this helps!