This will find all the uifigures you have open and store them in the variable f. Then you can delete them or whatever you want.
f = findall(groot(),'Type','figure');
is_uifig = false(numel(f),1);
for ii = 1:numel(f)
is_uifig(ii) = matlab.ui.internal.isUIFigure(f(ii));
end
f = f(is_uifig);