MATLAB: Do I receive a “Error while obtaining sizes from MEX S-function” error message

When I try to run a model with an S-Function, I get the following error:
Error while obtaining sizes from MEX S-function 'TEST12_sf' in 'TEST12SF/RTW S-Function'.
MATLAB error message:
Invalid MEX-file 'C:\TEST12\TEST12_sf.mexw32': The specified module could not be found.
The S-Function was built from a model that contained blocks from the Signal Processing Blockset. The machine that I am running on does not have the Signal Proessing Blockset installed. However, as far as I know, once the S-Function is built the original library should not be needed.

Best Answer

In this scenario, it is necessary to copy over the DSP shared library file dsp_rt.dll. It is installed to the $MATLABROOT/bin/win32 directory when the Signal Processing Blockset is installed. Copying this file to the $MATLABROOT/bin/win32 directory on the to the machine on which the model is run on will solve the issue.
Alternatively, you can rebuild the S-Function with a different Make command. To do this, navigate to "Simulation -> Configuration Parameters -> Real-Time Workshop", and set the "Make command" parameter to:
make_rtw OPT_OPTS="$(DEFAULT_OPT_OPTS) -DREBUILD_LIBRARIES"
You can read more about this situation and process in the documentation located here: