aft_save.m

来自「toolbox of BVQX, This is the access betw」· M 代码 · 共 60 行

M
60
字号
function hfile = aft_Save(hfile)
% AnyFileType::Save  - saves any BVQXfile object back to disk
%
% FORMAT:       object.Save;
%
% No input / output fields.

% Version:  v0.7b
% Build:    7082923
% Date:     Aug-29 2007, 11:03 PM CEST
% Author:   Jochen Weber, Brain Innovation, B.V., Maastricht, NL
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

% only valid for single file
if nargin < 1 || ...
    numel(hfile) ~= 1 || ...
   ~isBVQXfile(hfile, true)
    error( ...
        'BVQXfile:BadArgument', ...
        'Invalid call to %s.', ...
        mfilename ...
    );
end

% get super-struct
sc = bvqxfile_getscont(hfile.L);

% check filename
if isempty(sc.F)
    error( ...
        'BVQXfile:BadFilename', ...
        'File not yet saved. Use SaveAs method instead.' ...
    );
end

% what to do
try
    switch (lower(sc.S.FFTYPE))
        case {'bff'}
            sc.C = bffio(sc.F, sc.S, sc.C);
        case {'tff'}
            sc.C = tffio(sc.F, sc.S, sc.C);
        otherwise
            error( ...
                'BVQXfile:InvalidFileType', ...
                'Type not recognized (?FF): %s.', ...
                sc.S.FFTYPE ...
            );
    end
catch
    error( ...
        'BVQXfile:ErrorSavingFile', ...
        'Error saving file %s: %s.', ...
        bf, lasterr ...
    );
end

% set possibly changed content back
bvqxfile_setscont(hfile.L, sc);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?