issymmetric.m

来自「matlab波形优化算法经常要用到的matlab toolbox工具箱:yalm」· M 代码 · 共 21 行

M
21
字号
function issym=issymmetric(X)
%ISSYMMETRIC Check if variable is symmetric

% Author Johan L鰂berg 
% $Id: issymmetric.m,v 1.1 2006/08/10 18:00:21 joloef Exp $  

n = X.dim(1);
m = X.dim(2);
if (n==m)
    % What are the linar indicies to the transposed matrices
    if isa(X.basis,'lazybasis')
        issym = 1;
    else
        ind = reshape(reshape(1:n^2,n,n)',n^2,1);
        issym = norm(X.basis-X.basis(ind,:),1)<1e-10;   
    end
else
    issym = 0;
end

⌨️ 快捷键说明

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