필터 지우기
필터 지우기

Error while pressing button during loop cycle that changes directory

조회 수: 2 (최근 30일)
Lednion Bazar
Lednion Bazar 2016년 3월 30일
편집: Jan 2016년 3월 30일
Hello there!
I have a GUIDE interface that calls a script and allows the user to introduce the folder and other parameters. Initially I did this by making the interface to write a .mat file with the variables and then make the script to read that file, and everything worked fine. But now, I have decided to avoid writing files and use guidata to share the variables from interface to script. And it works, more or less. The key feature is that the script is a nested loop that does a lot of cds, and the interface has a button to stop the execution. If I press the stop button while the script is running, I get the following error
Undefined function 'tracking_interface_stop_push_Callback' for input arguments of type 'matlab.ui.control.UIControl'.
I have learned that If, in debug mode, I cd the location of the program files before pushing the button, the error is not thrown. I already added an "addpath" to the folder in which the programs are, in the interface mfile and in the script.
Why does this happen?
Thank you very much for your time
  댓글 수: 1
Jan
Jan 2016년 3월 30일
편집: Jan 2016년 3월 30일
Please post the relevant part of the code.
It seems like your try to add the folder to the path failed. Where is the function "tracking_interface_stop_push_Callback" stored? In an individual M-function or inside the GUI-M-File? Is it defined as a function handle or as string?
Prefer the usage of absolute paths instead of changing the current directory.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by