Error while pressing button during loop cycle that changes directory

2 次查看(过去 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 中查找有关 File Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by