This function has been discussed in your former thread http://www.mathworks.com/matlabcentral/answers/88498-problem-executign-mex-file already. It would be helpful for the ones, who wants to help you, if you provide any feedback at first and add a link to the former discussion also.
Please explain, what you have changed and explain "strange error" with more details.