mfbox_getsort.m
来自「toolbox for spm 5 for data, model free a」· M 代码 · 共 55 行
M
55 行
function y=mfbox_getsort(t,v,type)% 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 'temporalspatial' w = v.*conj(v); y = sortit(w); case 'temporal' w = real(v).^2; y = sortit(w); case 'spatial' w = imag(v).^2; y = sortit(w); case 'spatialvar' w = imag(t).^2; [w,y] = sort(w,'descend'); case 'temporalvar' w = real(t).^2; [w,y] = sort(w,'descend'); case 'temporalspatialvar' w = t.*conj(t); [w,y] = sort(w,'descend'); otherwise y = 1:size(v,2);endreturnfunction y=sortit(w)y = zeros(1,size(w,2));ly = 0;while (ly<min(size(w))) [x,yy] = max(w); oly = ly; for j=1:length(yy) if (ly==0 || ~any(y(1:ly)==yy(j))), ly = ly+1; y(ly) = yy(j); end end if (oly==ly || ly==length(y)), break; end if (ly>0), w(:,y(1:ly)) = -1; endendif (ly<size(w,2)) for j=1:size(w,2) if (ly==0 || ~any(y(1:ly)==j)), ly = ly+1; y(ly) = j; end endend
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?