MATLAB: Findobj give me back an empty value in 2018 vertion.

findobjMATLAB and Simulink Student Suite

I tray to run a code which wrote at 2013b version and run successfully. at 2018a version this code return to me an empty value.
openfig(strcat(FileDir2,FileName2,'.fig'),'new','invisible');
h2=findobj(gca,'Type','hggroup');
what can i do?

Best Answer

Prior to release R2014b, the contour function returned a contourgroup object that was of Type 'hggroup'.
With the major update to the graphics system in release R2014b, the contour function now returns a contour object whose Type is 'contour'.
For more information on the graphics changes in release R2014b, see this section of the documentation. Of particular interest to you, if you need this code to work in both release R2013b and R2018a, will be the page "Writing Code That Works in Multiple Releases" linked to by that section of the documentation.