run GUI without importing the folder in the current folder?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a GUI. When I run it with importing the folder in my current folder, it works fine. But when I just run it without importing any folder in my current folder, it shows error and it doesnt work. I would want my GUI to run when ever a user double clicks on it. I think it has something to do with path.
0 comentarios
Respuestas (1)
Image Analyst
el 12 de En. de 2016
What does "importing the folder in my current folder" even mean??? Do you mean that you have an m-file, or several of them, in some arbitrary folder, and then you copy that whole folder so that it is now a subfolder of your current folder?
Did you try to point to the path with the Set Path button on the Home tab of the tool ribbon?
2 comentarios
Image Analyst
el 12 de En. de 2016
That is not importing the folder. It is "setting" the current folder to that folder.
To add a folder to the search path, use addpath().
To save the newly modified search path for future MATLAB sessions, use the savepath() function. Alternatively, use addpath statements in a startup.m file to modify the search path programmatically at startup.
If you use addpath within a local function, the path change persists after program control returns from the function. That is, the scope of the path change is global.
Or else use the Set Path button like I already explained.
Ver también
Categorías
Más información sobre Search Path en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!