Why does my Command Window show different variables then my workspace?
Mostrar comentarios más antiguos
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
3 comentarios
What a pity that we see a screenshot only instead of the relevant part of the code. Please show, what is on the right and on the bottom.
Does "defaults", "files", "folders" or "programs" ring any bell for you? Where do these variables exist?
Dawn MacIsaac
el 15 de Mayo de 2019
Dawn MacIsaac
el 15 de Mayo de 2019
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!