www.gusucode.com > 三维模仿源码程序 > 三维模仿源码程序/MathRubik2/FindRubikAxes.m
function hAxes=FindRubikAxes(f) %FindRubikAxes - Find a Rubik-axes % hAxes=FindRubikAxes[(f)] if isempty(findobj('Type','figure')) error('No figures available') end if nargin==0 f=gcf; end hAxes=[]; if strcmp(get(f,'Tag'),'RubikFigure') ca=get(f,'CurrentAxes'); if strcmp(get(ca,'Tag'),'RubikAxes') hAxes=ca; else hAxes=findobj(f,'Tag','RubikAxes'); if isempty(hAxes) error('Can''t find the right axes in this figure') elseif length(hAxes)>1 error('Can''t select the right axes in this figure!') end end end if isempty(hAxes) hAxes=findobj('Tag','RubikAxes'); if isempty(hAxes) error('Cann''t find any Rubik axes'); elseif length(hAxes)>1 error('Can''t select the right axes!!') end end