bvqxfile_getmethods.m

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

M
51
字号
function ff_methods = bvqxfile_getmethods(ext)
% BVQXfile::<PRIVATE>::getmethods  - searching for methods for files
%
% THIS FUNCTION IS AN INTERNAL FUNCTION OF THE CLASS
%
% @BVQXfile
%
% AND IT SHOULD NEVER BE CALLED FROM OUTSIDE THE CLASS CODE

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

% create struct
ff_methods = struct;

% get path of this m-file
spfile = mfilename('fullpath');
sppath = fileparts(spfile);

% get extension list and add special type for AllFileTypes
extlist = fieldnames(ext);
extlist{end + 1} = 'aft';

% for each extension, look for methods
for ec = 1:length(extlist)

    % get extension and build empty sub struct
    typext  = lower(extlist{ec});
    typmst  = struct;

    % lookup methods
    typmeth = dir([sppath filesep typext '_*.m']);

    % iterate over found entries
    for mc = 1:length(typmeth)

        % put method name (without extension and typext into substruct
        uscpos = find(typmeth(mc).name == '_');
        typmst.(lower(typmeth(mc).name(uscpos(1)+1:end-2))) = ...
            typmeth(mc).name(1:end-2);
    end

    % put into global struct
    if numel(fieldnames(typmst)) > 0
        ff_methods.(typext) = typmst;
    end
end

⌨️ 快捷键说明

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