setcont.m

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

M
47
字号
function setcont(hfile, bc)
% BVQXfile::setcont  - override entire contents of object
%
% FORMAT:       setcont(obj, content)
%
% Input fields:
%
%       obj         non-ROOT BVQXfile object
%       content     1x1 content struct
%
% No output fields.

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

% argument check
if nargin ~= 2 || ...
    numel(hfile) ~= 1 || ...
    numel(bc) ~= 1 || ...
   ~isBVQXfile(hfile, true) || ...
    hfile.L == 1
    error( ...
        'BVQXfile:BadArgument', ...
        'Invalid object for assignment.' ...
    );
end

% get content first
cc = bvqxfile_getcont(hfile.L);
if numel(fieldnames(cc)) ~= numel(fieldnames(bc)) || ...
   ~all(strcmp(fieldnames(cc), fieldnames(cc)))
    error( ...
        'BVQXfile:BadArgument', ...
        'Mismatching fieldnames, content not set.' ...
    );
end

% assignment
try
    bvqxfile_setcont(hfile.L, bc);
catch
    rethrow(lasterror);
end

⌨️ 快捷键说明

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