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

📄 mesh_check.m

📁 Matlab下的EEG处理程序库
💻 M
字号:
function [n,exists] = mesh_check(p,meshtype)

% MESH_CHECK - Check for mesh data in p struct
%
% Useage: [n,exists] = mesh_check(p,meshtype)
%
% p is the eeg_toolbox struct (see eeg_toolbox_defaults)
% and meshtype is a string argument that is compared
% with all cells of p.mesh.data.meshtype.  If it matches,
% the return value 'n' is the matching cell, ie,
% p.mesh.data.meshtype{n} and the boolean 'exists'
% variable is true. This function is called from
% mesh_open and other mesh utilities to facilitate
% efficient handling of the p.mesh.data struct.
%

% $Revision: 1.3 $ $Date: 2003/04/07 06:12:02 $

% Licence:  GNU GPL, no implied or express warranties
% History:  02/2002, Darren.Weber@flinders.edu.au
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

n = 1;          % this is the first mesh in p.mesh.data
exists = 0;

if ~isempty(p.mesh.data),
    if isfield(p.mesh.data,'meshtype'),
        
        [s1,s2] = size(p.mesh.data.meshtype);
        
        n = s2 + 1;         % return cell number to add new meshtype
        
        indices = strcmp(p.mesh.data.meshtype,meshtype);
        found = find(indices);
        if found,
            n = found(1);
            exists = 1;
        end
        
        %             for i=1:s2,
        %                 if isequal(p.mesh.data.meshtype{i},meshtype),
        %                     n = i;      % cell number of current meshtype
        %                     exists = 1;
        %                 end
        %             end
    end
end

return

⌨️ 快捷键说明

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