debugging 'hierarchical' code stored in different folders

1 view (last 30 days)
Hi all
My file structure is:
./func/<functions>.m
./<main>.m
If I execute main.m, and the main.m file calls different function.m (in ./func/), then breakpoints are ignored in my main.m file.
If the current folder in the matlab GUI is not the same like main.m, then I either get an error message or the program runs empty, i.e. does not execute.
Anybody ever seen this? Any suggestions?
I run 7.11.1.866 (R2010b) Service Pack 1 on Linux ... 2.6.32-131.17.1.el6.x86_64 #1 SMP Wed Oct 5 17:19:54 CDT 2011 x86_64 x86_64 x86_64 GNU/Linux
Thanks for your help
Erich

Answers (1)

Walter Roberson
Walter Roberson on 29 Nov 2011
Your MATLAB GUI -- is that designed using GUIDE? If so then it probably codes most callbacks as strings instead of as function handles; callbacks coded as strings are evaluated at run-time in the base workspace, so a referenced routine might not be found at run-time because you have changed directories.
You can add the directory that main is found in, into the MATLAB path, or you can recode the callbacks to use function handles instead of strings.
  1 Comment
Erich
Erich on 30 Nov 2011
Hi Walter
Thanks for your reply.
> Your MATLAB GUI -- is that designed using GUIDE?
I don't know.
> You can add the directory that main is found in, into
> the MATLAB path
All paths are definitely included in Matlab paths.
Erich

Sign in to comment.

Categories

Find more on Dialog Boxes in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!