www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgcaloutput/MATLAB_M_file.m

    function out = MATLAB_M_file(obj,opt)
%M_FILE   Export to MATLAB file.

%  Copyright 2000-2011 The MathWorks, Inc.


% Check inputs
narginchk(1,2)
if nargin == 2
    if strcmpi(opt, 'getname')
        out = 'MATLAB file';
        return
    else
        error(message('mbc:cgcalinput:InvalidArgument11'))
    end
end        

% Get calibration interface
if isa(obj.filename, 'calibrationdata.minterface')
    cal = obj.filename; % interface can be set via the filename property for automated testing
    ok = true;
else
    [cal, ok] = cgminterface('w');
end

% Abort if failed
if ~ok
    out = false;
    return
end

% Export calibration
try
    pm = cgcalgui.progressmanager('Job', 'Export from CAGE');
    pCgcaloutputSetCalibration(cal, obj.ptrlist, true, pm);
    pm.stop;
    cal.commit;
    out = true;
catch
    pm.stop;
    out = false;
end