MATLAB: Does the Lookup Table(n-D) block error in Simulink 7.0 (R2007b)

simulink

I am using Simulink 7.0 (R2007b), and when I use the Lookup Table(n-D) block in any model, I get an error saying:
'sfun_lookupnd.c' not found.
I noticed that when I right click and select 'look under mask' for this block, and choose Edit S-function, it is looking for sfun_lookupnd.c, but is not able to find it.

Best Answer

The Lookup Table (n-D) block in Simulink 7.0 (R2007b) does not use a masked S-function underneath. In Simulink 6.6 (R2007a) and previous versions the lookup Table (n-D) had an underlying S-function.
For a later version such as R2007b showing the masked S-function behavior indicates that Simulink is picking up libraries from an earlier version installed in the machine.
As a workaround, please try one of the following:
a) Use SLUPDATE to replace blocks from previous releases with latest versions
b) Make sure that the current version's Simulink libraries are on top in MATLAB path to force Simulink to pick up the new version of the library.
Please execute the following in the MATLAB Command Window:
[matlabroot '\toolbox\simulink\blocks']
This will return the path of the library blocks in which Lookup tables reside.
Please add this path on top of the existing MATLAB path. To do this, navigate to File -> Set Path-> Add with Sub Folders.
Make sure that this path (which was returned in the Command Window earlier) is placed higher in the path than the older version of Simulink. Then save the path and restart MATLAB.
Simulink should now pick up the newer version of the Lookup table library.