Hi all,
I am writing some analysis software in 2015a with GUIDE.
I am looking to push a button that will reset the GUI to how it opened, emptying (by setting string) ALL edit boxes (easy) and all static text fields that are used as an output. I do not want to empty static text boxes whose tag contains "Text" as these are GUI labels next to edit boxes.
Currently I have the code below, but I don't know how to adapt it for the above…
% Empty All Static Text Boxes Whose Tag Contains "Output"
set(findall(handles.figure1,'Tag','Output'),'string',''); % findall finds invisible objects as well (findobj does not)
My previous attempt was:
% Get All Static Text Tags
AllStaticTextTags = findall(handles.figure1,'style','text')% Find All Static Text Tags Containing "Output"
StaticTextTagsContainingOutputIdx = contains(AllStaticTextTags,'Output'); % returns 1 if contains it 0 if not
StaticTextTagsContainingOutput = AllStaticTextTags(StaticTextTagsContainingOutputIdx);% Empty All Static Text Boxes Whose Tag Contains "Output"set(StaticTextTagsContainingOutput,'string','');
But understandably that doesn't work due to:
Undefined function 'contains' for input arguments of type 'matlab.ui.control.UIControl'.
Currently I am closing the window and re-running the main script but this is slow and inefficient.
EDIT: To clarify, the tags contain other letters also… I am looking to ONLY empty strings of static text boxes that have "Output" in their tag name.
Thanks,
Matt.
Best Answer