MATLAB: I am getting a make error when used the M-fuction in simulink for code generation. why? (Matlab 2012b)

embedded matlab functionmatlab codersimulink

the simple m-fuction has this code:
function y = fcn(p,v)
%#codegen
if (p==1 && v==1)
u=1;
else
u=0;
end
y = u;
I am getting this error:
Making simulation target "untitled1_sfun", …
'untitled1_sfun.bat' is not recognized as an internal or external command, operable program or batch file.

Best Answer

You probably need to use
mex -setup
to set your compiler.