📄 mfbox_sompnl.m
字号:
function [S,P]=mfbox_sompnl(X,varargin)%mfbox_sompnl - pnl ica algo using a som%% [S,P]=mfbox_sompnl(X[,argID,value[...]]);%% 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.txterror(nargchk(1,Inf,nargin));numofic = Inf;nonlintype = 'polynomial';verbose = 0;plotting = 0;gridsize = 10;l = nargin-1;for i=1:2:l op = varargin{i}; pa = varargin{i+1}; switch lower(op) case 'numofic' numofic = pa; case 'gridsize' gridsize = pa; case 'nonlintype' nonlintype = pa; case 'verbose' p = find(strcmp(pa,onoff)); verbose = p(1)-1; case 'plotting' p = find(strcmp(pa,onoff)); plotting = p(1)-1; otherwise error('Unknown parameter %s!\n',cmd); endendsX = size(X);numofic = min(sX(1),numofic);gridsize = max(gridsize,10);grid = mfbox_mkgrid(ones(1,numofic)*(2*gridsize+1))-gridsize;switch nonlintype case 'polynomial' A = eye(numofic,sX(1)); B = repmat([0,1,zeros(1,degree-2)],numofic,1); C = degree; case 'piecelin' A = eye(numofic,sX(1)); m = max(abs(X(:))) B = repmat([1,zeros(1,C-1)],numofic,1); C = repmat(linspace(-m,m,degree),numofic,1);endwhile (i<maxiter) mapgrid = domap(grid,A,nonlintype,B,C); %calculate adjustment [dA,dB,dC] = findmingradient(mapgrid,newgrid,A,nonlintype,B,C); A = A+dA; B = B+dB; C = C+dC;endreturnfunction r=lrfunc(m,d)if (d==1), r = linspace(1,0,m);elseif (d==Inf), r = exp(1:m)/exp(1);else r = (1:m).^(-d);endreturnfunction d=expdist(d,rho)d = exp((-d.^2)/(2*rho^2));returnfunction d=chardist(d,rho)d = 1*(abs(d)<rho);returnfunction d=quaddist(d,rho)d = max(0,1-(rho-d).^2);returnfunction d=lindist(d,rho)d = max(0,1-abs(rho-d));return
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -