<p>We set each panel to call the same dock/undock function.
This function is nested inside the main function so that it has access
to the main function's variables. A better way to do this is to make the
main function into a class, but this nested-function approach is fine
for simple applications.</p>
<p>Note that as soon as we set the "DockFcn" property the Dock/Undock
icon appears in the top-right of each panel. We use a cell-array to pass an
extra argument, the panel number, to the minimize function. This extra argument appears after the usual
<code>eventSource</code> and <code>eventData</code> arguments.</p>
<example><prestyle="background-color: #eeeeff; margin-left: 20px; margin-right: 20px"><fontcolor="#000011"><codeclass="COMMENT">% Set the dock/undock callback</code><br/>
<tdwidth="40%"height="15"bgcolor="#e4f0f8"align="left"><ahref="User_guide4_2.html"><fontface="arial"bgcolor="#e4f0f8"size="normal"underline="0"color="#000000">Minimize and maximize</font></a></td>