FastICA代码(matlab版本)

2023-11-13

[icasig, A, W] = fastica (eegdata, 'approach', 'symm', 'g', 'tanh');

function [Out1, Out2, Out3] = fastica(mixedsig, varargin)  
%FASTICA - Fast Independent Component Analysis
%
% FastICA for Matlab 7.x and 6.x
% Version 2.5, October 19 2005
% Copyright (c) Hugo G鋠ert, Jarmo Hurri, Jaakko S鋜el? and Aapo Hyv鋜inen.
%
% FASTICA(mixedsig) estimates the independent components from given
% multidimensional signals. Each row of matrix mixedsig is one
% observed signal.  FASTICA uses Hyvarinen's fixed-point algorithm,
% see http://www.cis.hut.fi/projects/ica/fastica/. Output from the
% function depends on the number output arguments:
%
% [icasig] = FASTICA (mixedsig); the rows of icasig contain the
% estimated independent components.
%
% [icasig, A, W] = FASTICA (mixedsig); outputs the estimated separating
% matrix W and the corresponding mixing matrix A.
【独立成分源信号;混合矩阵A;分离矩阵W】
X=A*S   S=W*X
% 
% [A, W] = FASTICA (mixedsig); gives only the estimated mixing matrix
% A and the separating matrix W.
%
% Some optional arguments induce other output formats, see below.
%
% A graphical user interface for FASTICA can be launched by the
% command FASTICAG
%
% FASTICA can be called with numerous optional arguments. Optional
% arguments are given in parameter pairs, so that first argument is
% the name of the parameter and the next argument is the value for
% that parameter. Optional parameter pairs can be given in any order.
%
% OPTIONAL PARAMETERS:
%
% Parameter name        Values and description
%
%======================================================================
% --Basic parameters in fixed-point algorithm:
%
% 'approach'            (string) The decorrelation approach used. Can be
%                       symmetric ('symm'), i.e. estimate all the
%                       independent component in parallel, or
%                       deflation ('defl'), i.e. estimate independent
%                       component one-by-one like in projection pursuit.
%                       Default is 'defl'.
【'approach' 参数用来指定 ICA 问题的求解方法或优化目标。
'defl':deflation这是 FastICA 的默认选项,FastICA 通过一个迭代的过程逐个估计每个源信号。。通常适用于源信号相互独立的情况。
'symm':parallel这是一种并行处理所有源信号的方法,FastICA 通过同时估计所有源信号来进行分离。。适用于源信号之间具有高度相关性的情况。】
%
% 'numOfIC'             (integer) Number of independent components to
%                       be estimated. Default equals the dimension of data.
%
%======================================================================
% --Choosing the nonlinearity:
%
% 'g'                   (string) Chooses the nonlinearity g used in 
%                       the fixed-point algorithm. Possible values:
%
%                       Value of 'g':      Nonlinearity used:
%                       'pow3' (default)   g(u)=u^3 
【选择适用于处理非高斯分布的信号】
%                       'tanh'             g(u)=tanh(a1*u)
【a 1是一个常数。这是一种常用的非线性映射函数,可以有效地处理高斯和非高斯信号。】
%                       'gauss             g(u)=u*exp(-a2*u^2/2)
【这种选择适用于处理高斯分布的信号。】
%                       'skew'             g(u)=u^2
% 
% 'finetune'        (string) Chooses the nonlinearity g used when 
【用于对独立成分进行微调。】
%                       fine-tuning. In addition to same values
%                       as for 'g', the possible value 'finetune' is:
%                       'off'              fine-tuning is disabled.
【当 'finetune' 参数设置为 True 时,FastICA 算法会执行一步细化(refinement)过程,以提高对源信号的估计精度。细化过程是通过最小化近似的负熵 (negentropy) 来完成的。
需要注意的是,'finetune' 参数会增加计算的复杂性和运行时间。如果对精确性要求不高,可以将 'finetune' 参数设置为 False 来加快算法的执行速度。】
%
% 'a1'                  (number) Parameter a1 used when g='tanh'.
%                       Default is 1.
% 'a2'                  (number) Parameter a2 used when g='gauss'.
%                       Default is 1.
%
% 'mu'          (number) Step size. Default is 1.
%                       If the value of mu is other than 1, then the
%                       program will use the stabilized version of the
%                       algorithm (see also parameter 'stabilization').
【'mu' 用于控制算法的收敛速度和稳定性,代表了学习率或步长因子。】
%
% 'stabilization'       (string) Values 'on' or 'off'. Default 'off'. 
%                       This parameter controls wether the program uses
%                       the stabilized version of the algorithm or
%                       not. If the stabilization is on, then the value
%                       of mu can momentarily be halved if the program
%                       senses that the algorithm is stuck between two
%                       points (this is called a stroke). Also if there
%                       is no convergence before half of the maximum
%                       number of iterations has been reached then mu
%                       will be halved for the rest of the rounds.
% 
%======================================================================
% --Controlling convergence:【收敛】
%
% 'epsilon'             (number) Stopping criterion. Default is 0.0001.
%
% 'maxNumIterations'    (integer) Maximum number of iterations.
%                       Default is 1000.
%
% 'maxFinetune'         (integer) Maximum number of iterations in 
%                       fine-tuning. Default 100.
%
% 'sampleSize'          (number) [0 - 1] Percentage of samples used in
%                       one iteration. Samples are chosen in random.
%                       Default is 1 (all samples).
%
% 'initGuess'           (matrix) Initial guess for A. Default is random.
%                       You can now do a "one more" like this: 
%                       [ica, A, W] = fastica(mix, 'numOfIC',3);
%                       [ica2, A2, W2] = fastica(mix, 'initGuess', A, 'numOfIC', 4);
%
%======================================================================
% --Graphics and text output:
%
% 'verbose'             (string) Either 'on' or 'off'. Default is
%                       'on': report progress of algorithm in text format.
%
% 'displayMode'         (string) Plot running estimates of independent
%                       components: 'signals', 'basis', 'filters' or
%                       'off'. Default is 'off'.
%
% 'displayInterval'     Number of iterations between plots.
%                       Default is 1 (plot after every iteration).
%
%======================================================================
% --Controlling reduction of dimension and whitening:
%
% Reduction of dimension is controlled by 'firstEig' and 'lastEig', or
% alternatively by 'interactivePCA'. 
%
% 'firstEig'            (integer) This and 'lastEig' specify the range for
%                       eigenvalues that are retained, 'firstEig' is
%                       the index of largest eigenvalue to be
%                       retained. Default is 1.
%
% 'lastEig'             (integer) This is the index of the last (smallest)
%                       eigenvalue to be retained. Default equals the
%                       dimension of data.
%
% 'interactivePCA'      (string) Either 'on' or 'off'. When set 'on', the
%                       eigenvalues are shown to the user and the
%                       range can be specified interactively. Default
%                       is 'off'. Can also be set to 'gui'. Then the user
%                       can use the same GUI that's in FASTICAG.
%
% If you already know the eigenvalue decomposition of the covariance
% matrix, you can avoid computing it again by giving it with the
% following options:
%
% 'pcaE'                (matrix) Eigenvectors
% 'pcaD'                (matrix) Eigenvalues
%
% If you already know the whitened data, you can give it directly to
% the algorithm using the following options:
%
% 'whiteSig'            (matrix) Whitened signal
% 'whiteMat'            (matrix) Whitening matrix
% 'dewhiteMat'          (matrix) dewhitening matrix
%
% If values for all the 'whiteSig', 'whiteSig' and 'dewhiteMat' are
% supplied, they will be used in computing the ICA. PCA and whitening
% are not performed. Though 'mixedsig' is not used in the main
% algorithm it still must be entered - some values are still
% calculated from it.
%
% Performing preprocessing only is possible by the option:
%
% 'only'                (string) Compute only PCA i.e. reduction of
%                       dimension ('pca') or only PCA plus whitening
%                       ('white'). Default is 'all': do ICA estimation
%                       as well.  This option changes the output
%                       format accordingly. For example: 
%
%                       [whitesig, WM, DWM] = FASTICA(mixedsig, 
%                       'only', 'white') 
%                       returns the whitened signals, the whitening matrix
%                       (WM) and the dewhitening matrix (DWM). (See also
%                       WHITENV.) In FastICA the whitening matrix performs
%                       whitening and the reduction of dimension. Dewhitening
%                       matrix is the pseudoinverse of whitening matrix.
%                        
%                       [E, D] = FASTICA(mixedsig, 'only', 'pca') 
%                       returns the eigenvector (E) and diagonal 
%                       eigenvalue (D) matrices  containing the 
%                       selected subspaces. 
%
%======================================================================
% EXAMPLES
%
%       [icasig] = FASTICA (mixedsig, 'approach', 'symm', 'g', 'tanh');
%               Do ICA with tanh nonlinearity and in parallel (like
%               maximum likelihood estimation for supergaussian data).
%
%       [icasig] = FASTICA (mixedsig, 'lastEig', 10, 'numOfIC', 3);
%               Reduce dimension to 10, and estimate only 3
%               independent components.
%
%       [icasig] = FASTICA (mixedsig, 'verbose', 'off', 'displayMode', 'off');
%               Don't output convergence reports and don't plot
%               independent components.
%
%
% A graphical user interface for FASTICA can be launched by the
% command FASTICAG
%
%   See also FASTICAG
 
% @(#)$Id: fastica.m,v 1.14 2005/10/19 13:05:34 jarmo Exp $
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Check some basic requirements of the data
if nargin == 0,
  error ('You must supply the mixed data as input argument.');
end
 
if length (size (mixedsig)) > 2,
  error ('Input data can not have more than two dimensions.');
end
 
if any (any (isnan (mixedsig))),
  error ('Input data contains NaN''s.');
end
 
if ~isa (mixedsig, 'double')
  fprintf ('Warning: converting input data into regular (double) precision.\n');
  mixedsig = double (mixedsig);
end
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Remove the mean and check the data
 
[mixedsig, mixedmean] = remmean(mixedsig);
 
[Dim, NumOfSampl] = size(mixedsig);
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Default values for optional parameters
 
% All
verbose           = 'on';
 
% Default values for 'pcamat' parameters
firstEig          = 1;
lastEig           = Dim;
interactivePCA    = 'off';
 
% Default values for 'fpica' parameters
approach          = 'defl';
numOfIC           = Dim;
g                 = 'pow3';
finetune          = 'off';
a1                = 1;
a2                = 1;
myy               = 1;
stabilization     = 'off';
epsilon           = 0.0001;
maxNumIterations  = 1000;
maxFinetune       = 5;
initState         = 'rand';
guess             = 0;
sampleSize        = 1;
displayMode       = 'off';
displayInterval   = 1;
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Parameters for fastICA - i.e. this file
 
b_verbose = 1;
jumpPCA = 0;
jumpWhitening = 0;
only = 3;
userNumOfIC = 0;
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Read the optional parameters
 
if (rem(length(varargin),2)==1)
  error('Optional parameters should always go by pairs');
else
  for i=1:2:(length(varargin)-1)
    if ~ischar (varargin{i}),
      error (['Unknown type of optional parameter name (parameter' ...
          ' names must be strings).']);
    end
    % change the value of parameter
    switch lower (varargin{i})
     case 'stabilization'
      stabilization = lower (varargin{i+1});
     case 'maxfinetune'
      maxFinetune = varargin{i+1};
     case 'samplesize'
      sampleSize = varargin{i+1};
     case 'verbose'
      verbose = lower (varargin{i+1});
      % silence this program also
      if strcmp (verbose, 'off'), b_verbose = 0; end
     case 'firsteig'
      firstEig = varargin{i+1};
     case 'lasteig'
      lastEig = varargin{i+1};
     case 'interactivepca'
      interactivePCA = lower (varargin{i+1});
     case 'approach'
      approach = lower (varargin{i+1});
     case 'numofic'
      numOfIC = varargin{i+1};
      % User has supplied new value for numOfIC.
      % We'll use this information later on...
      userNumOfIC = 1;
     case 'g'
      g = lower (varargin{i+1});
     case 'finetune'
      finetune = lower (varargin{i+1});
     case 'a1'
      a1 = varargin{i+1};
     case 'a2'
      a2 = varargin{i+1};
     case {'mu', 'myy'}
      myy = varargin{i+1};
     case 'epsilon'
      epsilon = varargin{i+1};
     case 'maxnumiterations'
      maxNumIterations = varargin{i+1};
     case 'initguess'
      % no use setting 'guess' if the 'initState' is not set
      initState = 'guess';
      guess = varargin{i+1};
     case 'displaymode'
      displayMode = lower (varargin{i+1});
     case 'displayinterval'
      displayInterval = varargin{i+1};
     case 'pcae'
      % calculate if there are enought parameters to skip PCA
      jumpPCA = jumpPCA + 1;
      E = varargin{i+1};
     case 'pcad'
      % calculate if there are enought parameters to skip PCA
      jumpPCA = jumpPCA + 1;
      D = varargin{i+1};
     case 'whitesig'
      % calculate if there are enought parameters to skip PCA and whitening
      jumpWhitening = jumpWhitening + 1;
      whitesig = varargin{i+1};
     case 'whitemat'
      % calculate if there are enought parameters to skip PCA and whitening
      jumpWhitening = jumpWhitening + 1;
      whiteningMatrix = varargin{i+1};
     case 'dewhitemat'
      % calculate if there are enought parameters to skip PCA and whitening
      jumpWhitening = jumpWhitening + 1;
      dewhiteningMatrix = varargin{i+1};
     case 'only'
      % if the user only wants to calculate PCA or...
      switch lower (varargin{i+1})
       case 'pca'
    only = 1;
       case 'white'
    only = 2;
       case 'all'
    only = 3;
      end
      
     otherwise
      % Hmmm, something wrong with the parameter string
      error(['Unrecognized parameter: ''' varargin{i} '''']);
    end;
  end;
end
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% print information about data
if b_verbose
  fprintf('Number of signals: %d\n', Dim);
  fprintf('Number of samples: %d\n', NumOfSampl);
end
 
% Check if the data has been entered the wrong way,
% but warn only... it may be on purpose
 
if Dim > NumOfSampl
  if b_verbose
    fprintf('Warning: ');
    fprintf('The signal matrix may be oriented in the wrong way.\n');
    fprintf('In that case transpose the matrix.\n\n');
  end
end
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Calculating PCA
 
% We need the results of PCA for whitening, but if we don't
% need to do whitening... then we dont need PCA...
if jumpWhitening == 3
  if b_verbose,
    fprintf ('Whitened signal and corresponding matrises supplied.\n');
    fprintf ('PCA calculations not needed.\n');
  end;
else
  
  % OK, so first we need to calculate PCA
  % Check to see if we already have the PCA data
  if jumpPCA == 2,
    if b_verbose,
      fprintf ('Values for PCA calculations supplied.\n');
      fprintf ('PCA calculations not needed.\n');
    end;
  else
    % display notice if the user entered one, but not both, of E and D.
    if (jumpPCA > 0) & (b_verbose),
      fprintf ('You must suply all of these in order to jump PCA:\n');
      fprintf ('''pcaE'', ''pcaD''.\n');
    end;
    
    % Calculate PCA
    [E, D]=pcamat(mixedsig, firstEig, lastEig, interactivePCA, verbose);
  end
end
 
% skip the rest if user only wanted PCA
if only > 1
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % Whitening the data
  
  % Check to see if the whitening is needed...
  if jumpWhitening == 3,
    if b_verbose,
      fprintf ('Whitening not needed.\n');
    end;
  else
    
    % Whitening is needed
    % display notice if the user entered some of the whitening info, but not all.
    if (jumpWhitening > 0) & (b_verbose),
      fprintf ('You must suply all of these in order to jump whitening:\n');
      fprintf ('''whiteSig'', ''whiteMat'', ''dewhiteMat''.\n');
    end;
    
    % Calculate the whitening
    [whitesig, whiteningMatrix, dewhiteningMatrix] = whitenv ...
                             (mixedsig, E, D, verbose);
  end
  
end % if only > 1
 
% skip the rest if user only wanted PCA and whitening
if only > 2
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % Calculating the ICA
  
  % Check some parameters
  % The dimension of the data may have been reduced during PCA calculations.
  % The original dimension is calculated from the data by default, and the
  % number of IC is by default set to equal that dimension.
  
  Dim = size(whitesig, 1);
  
  % The number of IC's must be less or equal to the dimension of data
  if numOfIC > Dim
    numOfIC = Dim;
    % Show warning only if verbose = 'on' and user supplied a value for 'numOfIC'
    if (b_verbose & userNumOfIC)
      fprintf('Warning: estimating only %d independent components\n', numOfIC);
      fprintf('(Can''t estimate more independent components than dimension of data)\n');
    end
  end
  
  % Calculate the ICA with fixed point algorithm.
  [A, W] = fpica (whitesig,  whiteningMatrix, dewhiteningMatrix, approach, ...
          numOfIC, g, finetune, a1, a2, myy, stabilization, epsilon, ...
          maxNumIterations, maxFinetune, initState, guess, sampleSize, ...
          displayMode, displayInterval, verbose);
  
  % Check for valid return
  if ~isempty(W)
    % Add the mean back in.
    if b_verbose
      fprintf('Adding the mean back to the data.\n');
    end
    icasig = W * mixedsig + (W * mixedmean) * ones(1, NumOfSampl);
    %icasig = W * mixedsig;
    if b_verbose & ...
      (max(abs(W * mixedmean)) > 1e-9) & ...
      (strcmp(displayMode,'signals') | strcmp(displayMode,'on'))
      fprintf('Note that the plots don''t have the mean added.\n');
    end
  else
    icasig = [];
  end
 
end % if only > 2
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The output depends on the number of output parameters
% and the 'only' parameter.
 
if only == 1    % only PCA
  Out1 = E;
  Out2 = D;
elseif only == 2  % only PCA & whitening
  if nargout == 2
    Out1 = whiteningMatrix;
    Out2 = dewhiteningMatrix;
  else
    Out1 = whitesig;
    Out2 = whiteningMatrix;
    Out3 = dewhiteningMatrix;
  end
else      % ICA
  if nargout == 2
    Out1 = A;
    Out2 = W;
  else
    Out1 = icasig;
    Out2 = A;
    Out3 = W;
  end
end

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

FastICA代码(matlab版本) 的相关文章

  • Matlab 中的多行匿名函数? [复制]

    这个问题在这里已经有答案了 是否可以在 Matlab 中创建多行匿名函数 没有合适的例子在文档中 http www mathworks com help matlab matlab prog anonymous functions html
  • 在 Matlab 中保存当前运行的脚本

    有没有办法保存Matlab中当前运行的脚本 我有一个脚本 它会自动备份一组脚本 但如果我更改了当前脚本 则保存的版本将过期 也许可以调用一些java Thanks 在 Yair Altman 网站上的某个地方 请参阅我的其他答案中的链接 他
  • 图像堆栈的最大强度投影

    我正在尝试重新创建该功能 max array 3 来自 MatLab 它可以获取 N 个图像的 300x300px 图像堆栈 我在这里说 图像 因为我正在处理图像 实际上这只是一个大的双数组 300x300xN 并创建一个 300x300
  • Matlab:掩码/创建一个知道其原点且具有一定半径的圆形 roi

    只是一个简单的问题 我有一张图像 并且提取了某个点 特征 我知道每个帧中该点的坐标 说 x1 和 y1 我需要一个圆形 ROI 形式 该点在图像上具有我选择的半径 我尝试了 impoly 和 roipoly 当我知道图像中的要点时 不知道如
  • 计算数组中接下来的 n 个元素的乘积

    我想计算下一个的乘积n矩阵的相邻元素 号码n要相乘的元素数应在函数的输入中给出 例如 对于此输入 我应该从第一个开始计算每 3 个连续元素的乘积 p ind max product 1 2 2 1 3 1 3 这给出了 1 2 2 2 2
  • MATLAB 滚动图

    我有一个脑电图数据库 我想绘制它 数据库是一个19 1000 134的矩阵 其中 19 是通道数 在第一种方法中 我只使用一个渠道 1000 个样本大小 采样率为 500 Hz 时为 1000 个点 即 2 秒数据 134 epochs的数
  • Matlab中转换数据类型的有效方法(double vs. im2double)

    我想将真彩色图像转换为双精度 据我所知有两种方法可以做到这一点 double rgb img im2double rgb img 哪一种效率更高 谢谢 他们都是不同的 im2double将图像的范围转换为0 1如果数据类型是uint8 or
  • MATLAB 中最有效的矩阵求逆

    在 MATLAB 中计算某个方阵 A 的逆矩阵时 使用 Ai inv A should be the same as Ai A 1 MATLAB 通常会通知我这不是最有效的求逆方法 那么什么是更有效率的呢 如果我有一个方程系统 可能会使用
  • 不等间隔时间序列的移动平均线

    我有一个证券交易所股票价格的数据集 时间 价格 但数据点之间的间隔并不相等 从 1 到 2 分钟不等 在这种情况下计算移动平均值的最佳实践是什么 如何在Matlab中实现呢 我倾向于认为 点的权重应该取决于自上一个点以来的最后时间间隔 Ma
  • 如何在 Matlab 中对数组应用低通或高通滤波器?

    有没有一种简单的方法可以将低通或高通滤波器应用于 MATLAB 中的数组 我对 MATLAB 的强大功能 或数学的复杂性 有点不知所措 需要一个简单的函数或一些指导 因为我无法从文档或网络搜索中找到答案 看着那 这filter http w
  • Matlab没有优化以下内容吗?

    我有一个很长的向量 1xrv 和一个很长的向量w1xs 和一个矩阵Arxs 它是稀疏的 但维度非常大 我期望 Matlab 对以下内容进行优化 这样我就不会遇到内存问题 A v w 但看起来 Matlab 实际上是在尝试生成完整的v w矩阵
  • 使用 MATLAB 进行线路跟踪

    我有一个图像 我想将其转换为逻辑图像 包括线条为黑色 背景为白色 当然 可以使用阈值方法来实现这一点 但我不想使用这种方式来做到这一点 我想通过使用线路跟踪方法或类似的方法来检测它 这是关于视网膜血管检测的 我找到了一个article ht
  • 有没有办法在matlab中进行隐式微分

    我经常使用 matlab 来帮助我解决数学问题 现在我正在寻找一种在 matlab 中进行隐式微分的方法 例如 我想区分y 3 sin x cos y exp x 0关于dy dx 我知道如何使用数学方法通常做到这一点 但我一直在努力寻找使
  • 我需要转义该 MATLAB 字符串中的字符吗?

    我想在 MATLAB 中调用以下 bash 命令 grep Up to test linux vision1 1 log awk print 7 I use system 在MATLAB中 但结果有错误 gt gt status strin
  • 如何告诉 mex 链接到 /usr/lib 中的 libstdc++.so.6 而不是 MATLAB 目录中的 libstdc++.so.6?

    现在 MATLAB 2012a 中的 mex 仅正式支持 gcc 4 4 6 但我想使用 gcc 4 7 风险自负 现在如果我直接用 mex 编译一些东西 它会抱怨 usr lib gcc i686 linux gnu 4 7 cc1plu
  • 黑白随机着色的六角格子

    我正在尝试绘制一个 10 000 x 10 000 随机半黑半白的六边形格子 我不知道如何将该格子的六边形随机填充为黑色和白色 这是我真正想要从这段代码中得到的示例 但我无法做到 https i stack imgur com RkdCw
  • 在 Matlab 中高效获取像素坐标

    我想在 Matlab 中创建一个函数 给定一个图像 该函数将允许人们通过单击图像中的像素来选择该像素并返回该像素的坐标 理想情况下 人们能够连续单击图像中的多个像素 并且该函数会将所有相应的坐标存储在一个矩阵中 有没有办法在Matlab中做
  • matlab中的排列函数是如何工作的

    这是一个有点愚蠢的问题 但我似乎无法弄清楚排列在 matlab 中是如何工作的 以文档为例 A 1 2 3 4 permute A 2 1 ans 1 3 2 4 到底是怎么回事 这如何告诉 matlab 3 和 2 需要交换 哇 这是我迄
  • 检测植物图片中的所有分支

    我想知道有什么可以检测下图中的所有绿色树枝 目前我开始应用 Frangi 过滤器 options struct FrangiScaleRange 5 5 FrangiScaleRatio 1 FrangiBetaOne 1 FrangiBe
  • 有效地绘制大时间序列(matplotlib)

    我正在尝试使用 matplotlib 在同一轴上绘制三个时间序列 每个时间序列有 10 6 个数据点 虽然生成图形没有问题 但 PDF 输出很大 在查看器中打开速度非常慢 除了以栅格化格式工作或仅绘制时间序列的子集之外 还有其他方法可以获得

随机推荐

  • compare4密钥过期解决方案

    删除C Users 用户名 AppData Roaming Scooter Software Beyond Compare 4下的所有文件 重启Beyond Compare 4即可 注意 用户名下的AppData文件夹有可能会被隐藏起来 其
  • 新手看过来----讨厌的运算符

    在计算机的世界里 虽然有很多数学的影子 但在计算公式转换为计算机语言时 很多表达方式并 不一致 这导致新手们初期不习惯 很容易用错 需要一个记忆的过程 就像学习英文 主谓宾定状补的先后顺序于中文是不一致的 在翻译句子时很容易产生中式英语 本
  • 【leetcode】1052. 爱生气的书店老板

    题目 解法 class Solution def maxSatisfied self customers grumpy X gt int 固定窗口最大和 param customers param grumpy param X return
  • hibernate查询方式

    1 OID 主键 查询 使用get方法 Customer customer session get Customer class 1l 使用load方法 Customer customer session load Customer cla
  • level2买股技巧_同花顺Level-2教你看清个股真实交易数据

    您可能感兴趣的话题 同花顺 核心提示 近几天 笔者在对比普通行情软件和同花顺Level 2行情软件在成交明细上的区别 发现这里面的学问非常大 近几天 笔者在对比普通行情软件和同花顺Level 2行情软件在成交明细上的区别 发现这里面的学问非
  • 贪心算法-背包问题C++

    1 问题 给定n种物品和一个背包 物品i的重量是Wi 其价值为Vi 背包的容量为C 应如何选择装入背包的物品 使得装入背包中物品的总价值最大 2 算法解析 此算法的贪心策略在于Sort排序函数 背包问题与0 1背包问题不同在于背包问题可以将
  • 【EI核心检索】第六届算法、计算与系统国际会议(ICACS 2022)

    会议官网 http icacs org 会议时间 2022年9月16 18日 主办单位 希腊色萨利大学数字系统学院 学术支持单位 英国斯特拉斯克莱德大学 会议地点 线上线下 希腊色萨利大学 会议出版 ACM会议论文集 会议收录 Ei Com
  • 单件模式:确保一个类只有一个实例,并提供一个全局访问点。

    问题 一个类只有一个实例的用处 线程池 缓存 对话框 处理偏好设置以及注册表等 全局变量的缺点 1 程序一开始就要创建好对象 一直未使用的话 就会浪费资源 2 全局变量只能约定只有一个实例 但是如果new新的实例 也是可以办到的 1 单件模
  • 最全面的Python重点知识汇总,建议收藏!

    这是一份来自于 SegmentFault 上的开发者 二十一 总结的 Python 重点 由于总结了太多的东西 所以篇幅有点长 这也是作者 缝缝补补 总结了好久的东西 Py2 VS Py3 print成为了函数 python2是关键字 不再
  • [DNN]CNN的结构分析和参数量计算

    文章目录 1 概述 1 1参数量计算方法 1 2神经元数量计算 1 3 连接数量计算 FLPOS 2 LeNet5结构和参数量计算 2 1 结构 2 2 对应的参数量计算 2 3 连接数量 FLOPS 资料来源 LeNet5分析 CNN参数
  • Mybatis-plus使用wrapper实现分页查询

    pom xml
  • 数据分级分类实施指南_逆袭!对数据分类分级治理快速提高企业数据管理水平...

    点击蓝色字免费订阅 每天收到这样的好信息 一 数据治理与数据分类分级 DAMA 数据管理知识体系指南 给出的定义 数据治理是对数据资产管理行使权力和控制的活动集合 规划 监控和执行 数据治理的职能是指导其他数据管理职能如何执行 数据治理就是
  • TeX Live for windows 安装及更新

    下载 install tl windows exe 或者install tl zip压缩包 解压之后右键以管理员身份运行install tl advanced bat 可以从官网下载 国内有镜像安装源 例如 https mirrors tu
  • Python智能合约开发指南(以太坊+web3py)

    在以太坊上获得一个基本的智能合约是一个很简单的事 只需google查询 ERC20代币教程 你会发现有关如何做到这一点的大量信息 以编程方式与合约交互完全是另一回事 如果你是一个Python程序员 那么教程就很少 所以写这个Python中的
  • java的队列实现方法_Java实现队列的三种方法集合

    数组实现队列 数组实现队列 class queue int a new int 5 int i 0 入队操作 public void in int m a i m 出队列操作 取出最前面的值 通过循环遍历把所有的数据向前一位 public
  • fairygui简单使用(unity)

    本文主要是引导怎么从fairygui页面ui编辑到unity的过程 如果想详细的那种 最好下载一个官方案例 里面都有详细的教程 不过这个对于新手来说还是挺好的 因为我刚开始以为是自己创建代码 自己写 先去官网下载一个gui编辑器 这是API
  • utf-8和gb2312的相互转换

    最近老是涉及到编码与解码的问题 GB2312转UTF 8 又或者UTF 8转GB2312 无意中在CSDN闲逛发现了一个CString 转UTF 8的思路 现摘寻下来 免得到时又找不着了 CString UTF8Convert CStrin
  • GDB 调试过程

    一 gdb 1 gdb 启动gdb 2 gdb tui 启动gdb 并且分屏显示源代码 3 gdb app 启动gdb调试指定程序app 4 gdb
  • WebSocket 前端使用

    h5提供了WebSocket网络协议 可以实现浏览器与服务器的双向数据传输 构造函数 WebSocket url protocol url WebSocket API URL URL之前需要添加ws 或者wss 类似http https p
  • FastICA代码(matlab版本)

    icasig A W fastica eegdata approach symm g tanh function Out1 Out2 Out3 fastica mixedsig varargin FASTICA Fast Independe