필터 지우기
필터 지우기

run GUI without importing the folder in the current folder?

조회 수: 1 (최근 30일)
Praveen Choudhury
Praveen Choudhury 2016년 1월 12일
댓글: Image Analyst 2016년 1월 12일
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.

답변 (1개)

Image Analyst
Image Analyst 2016년 1월 12일
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
Praveen Choudhury
Praveen Choudhury 2016년 1월 12일
importing the folder means I am adding the folder in my matlab window (in the left window which says current folder). I want to write a code where the folder automatically gets added in the matlab window(current folder)
Image Analyst
Image Analyst 2016년 1월 12일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Search Path에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by