I came across the following problem when investigating how to link fortran exe s from within the Matlab environment. To start with I had a look at some examples, which made sense but didn't run properly.
I encountered the following error when running the command 'y = timestwo(x)'. The root of the problem I eventually realized, when trying to compile the .F file outside of Matlab
">> mex 'C:Program FilesMATLABR2007bexternexamples
f90: Severe: No such file or directory
... file is 'FilesMATLABR2007bexternexamples
C:PROGRA~1MATLABR2007BBINMEX.PL: Error: Compile of 'C:Program FilesMATLABR2007bexternexamples
efbook imestwo.F' failed.
??? Error using ==> mex at 208
Unable to complete successfully."
The solution to this problem, is that Matlab is trying to write the file timetwo.i to a write-protected drive. This issue may seem obvious to some, but as somebody who is used to having admin rights to all drives, it took me a long time to think of, and the error message was certainly not forthcoming.
Hope this help some others,