Hi,
I am assuming that you are using interpn function with ‘makima’ interpolation method in your S Function. The MATLAB Function block and S Function only supports the subset of MATLAB language features that are compatible with C/C++ code generation. The interpn function does not support the 'makima' interpolation method for code generation, so you cannot use it in a MATLAB Function block for code generation.
To resolve your issue, you can try using the makima function, declared as an extrinsic using the coder.extrinsic command. Your MATLAB Function block's code might look something like this:
function y = fcn(u)
coder.extrinsic('makima');
y = 0;
y = makima(1:10, 1:10, u);
end
You can read more about how to generate code for functions that are not supported for code generation in the link below:
Hope this helps.