Error Calling Generated SFunction - resulting in very slow model exectution

1 view (last 30 days)
I am attempting to run a simulink model on my laptop that currently runs with no issues on my desktop PC. I installed all the same versions of MATLAB, Simulink, and various toolboxes to replicate the software on both machines. The laptop has computing power virtually identical to the desktop, and neither computer shows signs of nearing an limits during model execution.
I transferred my main research model to my laptop to run, and it runs incredibly slowly (about 30 times slower than the real-time model should run). This model has a host of MATLAB Function Blocks in it. I get an error associated with each one of these blocks upon completion of model execution. The error states:
"Error calling generated SFunction, untitled_sfun. Undefined function untitled_sfun' for input arguments of type 'double'." Again, this error is repeated for every MATLAB Function Block in my model.
There is a file called untitled_sfun.mexw32 in the folder with my model. I presume that the s-function was built correctly the first time I ran the model on this computer. I have looked through all the settings or configuration parameters I can find to see what might be different between the two computers.
I don't recall ever facing this issue when I originally built the model on my desktop PC, but I can't imagine it to be something much more complicated that a simple setting difference. I did run mex -setup and selected the default compiler.
Any suggestions are much appreciated. Thanks.

Accepted Answer

Mike Powell
Mike Powell on 23 May 2012
It turns out that the wireless connection to both my home and work networks was the only thing causing this model to run slowly. When I disconnected from the wireless network, the model ran in real time. When I connected via CAT 5 cable to the LAN, it ran fine. Only when I had a wireless connection open did the model run very slowly. I can't explain it, but that's what was happening.

More Answers (1)

Kaustubha Govind
Kaustubha Govind on 22 May 2012
Is the name of your model untitled.mdl? Could you try deleting the untitled_sfun.mexw32 file, and try re-running your model? Also, is the desktop a 32-bit machine, and the laptop a 64-bit machine?
  1 Comment
Mike Powell
Mike Powell on 23 May 2012
I am running 32-bit MATLAB on a 64-bit machine in order to use the Data Acquisition Toolbox. I got advice from the MATLAB Tech Support guys to clear all the .mex files, delete the slprj folder, and try running again. I was hopeful, but that didn't do the trick. See my answer below, and thanks for the comments.

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!