MATLAB: Mex file compiling error

c file s-functionmex compiler

I want to create mex file but the compiler give this error..
1. Error ForceSensor.c: 121 undeclared identifier `USE_DEFAULT_SIM_STATE' 2. Warning ForceSensor.c: 121 possible usage of USE_DEFAULT_SIM_STATE before definition 1 errors, 1 warnings
anybody could help

Best Answer

Is this an S-function? If yes, you are probably missing:
#include "simstruc.h"