> > You said that in order to create mex file from your testfunc_mex.c, you needed to run testfunc_mex.bat. I didn't understand this part. Do you run it outside matlab prior to mex command? Could you, please, elaborate on that? Sorry if my question may seem naive. > > Thank you > Valery
Usually when we create .mex files, we are told that we should write C code (.c file) and then in matlab command window, we would use the command "mex filename.c", this will produce .mex file.
However, the .c files created by the coder doesn't behave like this. As I wrote above, if I try "mex testfunc_mex.c", then it will yield error and doesnt produce .mex file.
In order to produce .mex file from .c files generated from coder. We must find and run testfunc_mex.bat (alsop generated by the coder), under windows. This .bat is bit of a magical black box to me, and it will create .mex file. (after using coder, there is already a .mex file created, to test this testfunc_mex.bat works, you can delete the original .mex file, and you'll see, after you run testfunc_mex.bat, a new .mex file is generated somewhere inside the folder). (This also mean, you will never need to run "mex" function inside matlab at any point)