Additionally, I just found that the function "cmap" can be called from mproc in a different line of code. So this specific line of code is just refusing to work for seemingly no reason. If you see the reason please let me know!
Function in MATLAB's path not call-able by another function in MATLAB's path despite both functions being call-able in Command Window
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Lars Nelson
am 6 Jun. 2023
Kommentiert: Cris LaPierre
am 7 Jun. 2023
I have a function, "cmap", that refuses to be called by another function "mproc", though both are in MATLAB's path (I have repeatedly verified that both functions are in folders in MATLAB's path). "mproc" runs fine and can call other functions that are not "cmap", but when it gets to cmap I get one of two errors, copied and commented below:
% 'cmap' is not found in the current folder or on the MATLAB path, but exists in:
% C:\Users\my_name\Documents\MATLAB\Image Processing\Cmap functions
% Change the MATLAB current folder or add its folder to the MATLAB path.
or
% Unrecognized function or variable 'cmap'.
The folder that it's in IS on the MATLAB path, however. Even so, when I click "add its folder to the MATLAB path" anyways, the same error persists when I try to use it again.
This is particularly confusing because I can call "cmap" in the Command Window (since it's in MATLAB's path). I was not having this issue earlier today but suddenly MATLAB just refuses to use "cmap" in "mproc". Am I missing something completely obvious?
Here is a picture of my MATLAB, showing "cmap" in a folder that is on the MATLAB path, mproc is in the "Image stack functions" folder (also in MATLAB's path). I have highlighted the line of code where the program breaks and an error message is displayed below.
3 Kommentare
Cris LaPierre
am 6 Jun. 2023
Bearbeitet: Cris LaPierre
am 6 Jun. 2023
You've ruled out the main culprits I would suspect. Does this go away after restarting MATLAB? Is this behavior reproducible on other machines?
Akzeptierte Antwort
Lars Nelson
am 7 Jun. 2023
Verschoben: Matt J
am 7 Jun. 2023
1 Kommentar
Cris LaPierre
am 7 Jun. 2023
Please consider reporting this here: https://www.mathworks.com/support/contact_us.html
Weitere Antworten (2)
Matt J
am 6 Jun. 2023
So this specific line of code is just refusing to work for seemingly no reason.
Maybe there is some invisible character in that line that is corrupting the call? Try deleting the whole line and retyping it.
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!