MATLAB is calling the wrong function, but the 'which' command gives me the right one. How to fix?
Ältere Kommentare anzeigen
I am trying to debug some code by taking a local copy of a particular function and getting MATLAB to call this one. However it is not working. Example: fvcustom is an object that multiple other objects use, but it has a bug. I take a local copy of fvcustom and a 'which' command confirms that this is the highest version in my path
>> which fvcustom
my_local_path\fvcustom.m
However when I try to debug and call a parent object to fvcustom, it calls the function in the central repository which I can't edit:
repo\fvcustom.m
Can anyone help me out with this? I must be doing something stupid.
Thanks
Akzeptierte Antwort
Weitere Antworten (2)
Star Strider
am 4 Sep. 2015
Call:
which fvcustom -all
or:
Q = which('fvcustom','-all')
to find all of them. The function form returns a cell array with the full path to each of them.
4 Kommentare
Rob Holmes
am 4 Sep. 2015
Star Strider
am 4 Sep. 2015
I intended that it would give you the paths and you could then specify the one you wanted. Apparently that’s not the solution.
If you want to get only the one you want, one possibility is to save the directory information to the one you want to ignore, and temporarily change its name to fvcuston#. Adding the ‘#’ will not corrupt the name, other than to have the OS ignore it when you call ‘fvcustom’. Just remember to change it back when you’ve finished your project.
Rob Holmes
am 4 Sep. 2015
Star Strider
am 4 Sep. 2015
My pleasure.
A vote, mayhap?
Image Analyst
am 4 Sep. 2015
0 Stimmen
Try using the path tool (on the toolbar) to change the order of the search path to put the one you want first.
1 Kommentar
Rob Holmes
am 4 Sep. 2015
Kategorien
Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!