MATLAB: Difference between properties and handles of figure

figureguihandlesproperty

I'm trying to understand the difference between the handles of a figure and the property values of a figure.
for example I can use
h=figure
then I can get the properties of h by using inspect. Also I can get the handles by using handles=guihandles(h).
What is the difference between those values and are the property values of the figure actually somewhere in the handles too?
Another thing, if I use handles=guihandles(h) and then handles.FigureToolBar.Visible='off' my figure is directly updated. So why do I need to call guidata(h,handles) as I have seen in some documentations?
Thanks a lot for helping

Best Answer

The figure command replies the "handle" of the figure, which is a kind of pointer to it. You can use it to identify the figure uniquely and access its properties.
The command guihandles creates a struct, which makes it easy to access the propertioes of the figure (or other GUI object).
guidata writes or reads a struct from the figure's ApplicationData, which is useful to share data between callbacks of a figure. The usual name "handles" for this struct is confusing, because it can contain anything and not only handles. "guidata" would be a much better name, but unfortunately this is used for the command already.