"Duckhwan " <firstname.lastname@example.org> wrote in message news:email@example.com... > I try to use function 'FILENAME' in my matlab script. > > I have mexglx file. (I'm working on MacOSX 10.8.2)
MEX-files are platform-specific. For Mac, you will need a version of the MEX-file compiled on Mac. It will have the extension .mexmaci64.
Before you try it, renaming your Linux MEX-file to have that extension won't work. You will need to recompile or ask the person that gave it to you to recompile it.
> When I try, the error message is "Attempt to execute SCRIPT FILENAME as a > function:"
That directory must have a script file (containing help text) with the extension .m and the same name as the MEX-file. If MATLAB can't find a MEX-file for the architecture on which you're running MATLAB, but there's a MATLAB program file with the extensions .m or .p, MATLAB will attempt to execute that program file.