gusucode.com > 基于matlab软件,实现双目视觉原理的摄像机标定,能根据各视场图像求内、外部参数 > 基于matlab软件,实现双目视觉原理的摄像机标定,能根据各视场图像求内、外部参数/TOOLBOX_calib/fixvariable.m

    % Code that clears an empty variable, or a NaN vsriable.
% Does not clear structures, or cells.

if exist('var2fix')==1,
    if   eval(['exist(''' var2fix ''') == 1']),
        if eval(['isempty(' var2fix ')']),
            eval(['clear ' var2fix ]);
        else
            if eval(['~isstruct(' var2fix ')']),
                if eval(['~iscell(' var2fix ')']),
                    if eval(['isnan(' var2fix '(1))']),
                        eval(['clear ' var2fix ]);
                    end; 
                end;
            end;
        end;
    end;
end;