MATLAB: Do I receive an error when using a tunable table with the 3-D Look-Up Table Block in Real-Time Workshop

3-d3derrorlookupr12.1pv1_swatsimulink codertabletunable

Why do I receive an error when using an S-function generated using the S-function Target in Real-Time Workshop which contains a 3-D Look-Up Table Block with a tunable table parameter?
When I try to do a model update, I receive the following error:
Error using ==> set_param
Error reported by S-function 'test_sf' in block 'untitled/RTW S-Function':
Parameter d has to have 2 dimensions.

Best Answer

This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
To work around this issue, generate the S-function as usual. Ignore the error that occurs, and insert the S-function manually using an S-function Block. In the 'parameter' portion of the S-function Block dialog, 'flatten' the table parameter. For example, if the table parameter was originally 'd', enter 'd(:)' into the parameter dialog.