I created a GUI called "stack" in MATLAB. It has a .m
file associated with it. This GUI is called on multiple occasions by another GUI in the same folder.
Now I discovered that "stack" is a built-in function in MATLAB which I need to use for something else in the same working directory. All calls to the stack function somehow invoke the GUI by calling the stack.m
script.
I do not want to rename this because it is used in many places.
Is there a way to use the built-in function without needing to rename? Some way to reference the function and the script separately?
Disclaimer: Please, please, please, do not do this.
Assuming that your own stack.m
is only in the search path because it is in the current folder, then the easiest fix is to create some dummy subfolder, navigate to it, execute Matlabs stack
function (which is the only stack
in the current searchpath) and navigate back.
Here I have exemplified it with magic
:
function a= magic
n=5;
cd dummy
a= magic(n);
cd ..
where dummy
is the name of the subfolder.