mfbox_calcthreshold.m

来自「toolbox for spm 5 for data, model free a」· M 代码 · 共 46 行

M
46
字号
function vAp=mfbox_calcthreshold(A,S,type,threshold,design,reference)% Copyright by Peter Gruber % Signal Processing & Information Theory group% Institute of Biophysics, University of Regensburg, Germany% Homepage: http://research.fabian.theis.name%           http://www-aglang.uni-regensburg.de%% This file is free software, subject to the % GNU GENERAL PUBLIC LICENSE, see gpl.txtswitch type    case 'variance'        vA = var(A);        [vA,vAp] = sort(vA,'descend');        vA = vA/sum(vA);        vAp = vAp(vA>threshold);    case 'design'        vA = var(A);        [vA,vAp] = sort(vA,'descend');        if (~isempty(design))            t = false(1,length(vA(:)));            tv = zeros(1,length(vA(:)));            for i=1:size(design,2)                d = design(:,i);                l = abs(mfbox_corr(d,A(:,vAp)));                tv = tv+l;                t = t|(l>threshold);            end            if (all(~t(:))), t(tv==max(tv(:))) = true; end            vAp = vAp(t);        end    case 'reference'        vA = var(A);        [vA,vAp] = sort(vA,'descend');        if (~isempty(reference))            tv = mfbox_overlap(S(:,vAp),reference);            t = tv>threshold;            if (all(~t(:))), t(tv==max(tv(:))) = true; end            vAp = vAp(t);        end    otherwise        [vA,vAp] = sort(var(A),'descend');endreturn

⌨️ 快捷键说明

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