Why does my Command Window show different variables then my workspace?
Show older comments
I am creating a gui and I have some nested functions which are called from the GUI callback functions. One is called validateFolder(handles, source). When I debug inside this function, I expect to see the function variables only. When I put the breakpoint at the top of the function, I should see handles and source in the workspace, and nothing more. When I use whos in the command winodw, that is what I see. But my workspace, which indicates that its displaying the workspace for the validateFolder() function, shows a different set of variables. Note that this problem is not isolated to this script (it happens in other programs I write too). See screen shot of function, command window, and workspace below:

Here is the full code from the function:
function handles = validateFolder(handles, source)
dataFolder = handles.folders.dataFolder;
isMissing = missingFiles(dataFolder, source);
if ~isMissing
set(handles.gui.btn_load, 'enable', 'ON');
set(handles.gui.rb_fromraw, 'enable', 'ON', 'value', 1);
message = ['Ready to load data from: ' source.studentInfo];
displayMessage(message, handles.gui.message_statusA, [.04 .4 .26]);
else
files = struct2cell(source);
set(handles.gui.btn_load, 'enable', 'OFF');
message = ['Curent Data Folder has no valid source file - add ' files{isMissing}];
displayMessage(message, handles.gui.message_statusA, 'red');
end
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects 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!