Statement findobj(propertyName, propertyValue, ...) doesn't work and return only the first handle having propertyName, propertyValue . Solution element
Bug Description
Statement findobj(propertyName, propertyValue, ...) doesn't work and return only the first handle having propertyName, propertyValue
Steps to reproduce
Example comes from the help page "help findobj"
delete(h1); delete(h2)
// Create a figure
h1=scf(10);
// Put a text in the figure
uicontrol(h1, "style","text", ...
"string","This is figure 1", ...
"position",[50 70 100 100], ...
"fontsize",15, ...
"tag","Alabel");
// Find the object which "tag" value is "Alabel"
lab=findobj("tag","Alabel");
disp("The text of the label is """+lab.string+"""");
// Create a figure
h2=scf(20);
h2.figure_position = [900,200]
// Put a text in the figure
uicontrol(h2, "style","text", ...
"string","This is figure 2", ...
"position",[100 70 100 100], ...
"fontsize",15, ...
"tag","Alabel");
// Find the object which "tag" value is "Alabel"
lab=findobj("tag","Alabel");
disp("The text of the label is """+lab.string+"""");
a1=findobj(h1,"tag","Alabel");
a1.parent.figure_id // OK
a2=findobj(h2,"tag","Alabel");
a2.parent.figure_id // OK
a=findobj("tag","Alabel");
a(1).parent.figure_id // Must be 10
a(2).parent.figure_id // Must be 20
What is the expected correct behavior?
Detection in all handles
Error log
--> a(2).parent.figure_id // Must be 20
Indice invalide.