⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 call.m

📁 toolbox of BVQX, This is the access between BV and matlab. It will help you to analysis data from BV
💻 M
字号:
function varargout = Call(hfile, method, varargin)
% BVQXfile::Call  - call a method (needed for older MATLAB versions)
%
% FORMAT:       [varargout] = Call(hObject, method, ...)
%
% Input fields:
%
%       hObject     1x1 BVQXfile object handle
%       method      name of method to call
%       ...         arguments
%
% Output fields:
%
%       varargout   as requested
%
% Note: this call usually produces the same effect as overloading
%       subsref, but in older releases this might be required to
%       obtain multiple outputs. So, 
%
% >> [output{1:nout}] = Call(hObject, 'method', ...);
%
%       and
%
% >> [output{1:nout}] = hObject.method(...);
%
%       should produce the same results.

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

% global config
global bvqxfile_config;

% to check availability of functions use own dir!
persistent call_methdir;
if isempty(call_methdir)
    call_methdir = [fileparts(mfilename('fullpath')) '/private/'];
end

% argument check
if nargin < 2 || ...
    numel(hfile) ~= 1 || ...
   ~isBVQXfile(hfile, true) || ...
   ~ischar(method) || ...
    isempty(method)
    error( ...
        'BVQXfile:BadSubsRef', ...
        'No S struct given or empty.' ...
    );
end
sc = bvqxfile_getscont(hfile.L);
otype = sc.S.Extensions{1};

% check all file types first
if exist([call_methdir 'aft_' method(:)' '.m'], 'file') == 2
    otype = 'aft';
end

% try call
try
    if nargout > 0
        varargout = cell(1, nargout);
        eval(['[varargout{1:nargout}]=' lower(otype) '_' method(:)' ...
              '(hfile, varargin{:});']);
    else

        eval(['[varargout{1}]=' lower(otype) '_' method(:)' ...
              '(hfile, varargin{:});']);
    end
catch
    error( ...
        'BVQXfile:CallError', ...
        'Error calling method ''%s'' of type ''%s''.', ...
        method(:)', ...
        upper(otype) ...
    );
end

% unwind stack
if bvqxfile_config.unwindstack
    BVQXfile(0, 'unwindstack');
end

⌨️ 快捷键说明

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