fullfile(matlabroot,'extern', 'include', 'mex.h')
mex.h belongs to Matlab's toolbox files.
"I am using IAR embedded workbench to build and compile the code" - this does not explain uniquely, what you are exactly doing. It seem like you forgot to include the required path.