MATLAB using .m file in preference to .mexw64

1 view (last 30 days)
I am using a toolbox which has required me to compile certain functions from c code. This has generated a .mexw64 file but unless I am working in the folder where this file is located MATLAB runs the .m file of the same name. (The .m file merely outputs a comment that this function needs to be compiled from the .c file.)
Is there something I should set in the path so that MATLAB will use the .mexw64 file even when I am working in a different folder?

Accepted Answer

James Tursa
James Tursa on 30 Nov 2017
Edited: James Tursa on 30 Nov 2017
Either:
- Put the .mexw64 file in the same directory as the associated .m file
Or:
- Make sure the directory where the .mexw64 file is located is in the path list prior to the directory where the .m file is located.
The first method above is probably the preferred method so that a user can easily associate that those two files are related. Text at the top of the .m file can then be used as help for the .mexw64 file.
  1 Comment
S Crombie
S Crombie on 30 Nov 2017
Thank you very much. I hadn't realised the importance of the order of folders in the path.

Sign in to comment.

More Answers (0)

Categories

Find more on Search Path in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!