MATLAB: MEX level2 S-function “sfunc_basic” must be called with at least 4 right hand arguments

mex level2 s-functionsimulink

Can any one please explain me what does this error mean. I tried to google it but could not find anything relevant. I get this while running the Simulink(mexing the file does not throw any error).

Best Answer

I suspect you are mistakenly using the S-function block for a Level-2 S-function, or a Level-2 MATLAB S-Function block for a Level-1 S-function. Try switching to the other block and see if the error goes away.