Matlab does not recognize my executable file unless I locate it in the Matlab shortcut's start path

10 views (last 30 days)
Environment: 1) Windows 7 64 bit 2) Matlab R2011b 3) Windows path environment variable includes the path to my *.mexw64 file and all its required dll's. 4) Matlab path variable includes the path to my *.mexw64 file
Issue: Matlab does not recognize my 'C' executable 'ConnSpiderServer.mexw64' unless I locate it in the start folder of the Matlab shortcut. (When I locate it there my command works fine).

Accepted Answer

Michael
Michael on 31 Oct 2011
I talked with Matlab's Technical Support, and between us we found the solution.
First Matlab uses a file known as pathdef.m to define its paths. This file is located at %MATLAB_ROOT%\toolbox\local. I was using a startup.m file to add the path to my *.mexw64 file, but this extra path was not updating the pathdef.m file that Matlab uses. Apparently, (even though I was starting Matlab as a user with administrator rights), the pathdef.m file was not getting updated by startup.m. The solution was to manually edit pathdef.m, save it to a temporary folder, and then to copy it to the %MATLAB_ROOT%\toolbox\local location. (Windows 7 asks perimission to perform the copy when you do this). After doing this Matlab can now see ConnSpiderServer.mexw64 (my mex command).
  1 Comment
Michael
Michael on 31 Oct 2011
Be sure you don't have a pathdef.m file in your current folder, or Matlab will use it instead of the one at %MATLAB_ROOT%\toolbox\local.

Sign in to comment.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!