when i am running a gui program a window is coming ask me for change the directry
조회 수: 1 (최근 30일)
이전 댓글 표시
i have write a program in matlab gui. when i run the program a window is coming asking for change the directory. i want that this window never comes. how can i solve the problem? please help me. thank you in advance.
댓글 수: 0
채택된 답변
Friedrich
2011년 7월 14일
Hi,
do you start the GUI out of the ML editor where the M file is open and your current folder is different from the folder where the GUI is located? If so, the editor recognizes this and ask you if you want to change to that folder where the GUI is located since its not an the ML path. Simply change into the folder with the GUI before running it and the message shouldnt appear.
댓글 수: 2
Friedrich
2011년 7월 14일
was this your problem? if so, please accept my answer to mark this thread as closed.
추가 답변 (1개)
Image Analyst
2011년 7월 15일
I've been asking the Mathworks for that for a long time, where if you click on a text file at the bottom of the editor, it automatically changes the current folder to the folder where that file lives. Apparently they don't want to do that for some reason, not even as a user-selectable preference which I pleaded for. So we're stuck with the "Change Folder" "Add to Path" "Cancel" "Help" question when you try to run that file.
I think you can add these lines to your startup.m file so that all your folders and subfolders are already on your path.
addpath(genpath('c:\yourTopLevelFolder'));
savepath
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!