The following stackoverflow qestion:
Matlab: How to obtain all the axes handles in a figure handle?
identifies how to get handles to all of the axes from a figur
Just slightly modifying the code of my answer at the stackoverflow question you mentioned:
axesHandles = get(fig, 'Children');
classHandles = handle(axesHandles);
count = length(axesHandles);
isLegend = false(1, count);
for i = 1:count
isLegend(i) = strcmp(class(classHandles(i)), 'scribe.legend') == 1;
end
legendHandles = axesHandles(isLegend);
Unfortunately, this solution depends on implementation details.