issym.m

来自「matlab的模式识别toolbox」· M 代码 · 共 39 行

M
39
字号
%ISSYM Checks whether a matrix is symmetric%%   OK = ISSYM(A,DELTA)% % INPUT% 	A      Dataset% 	DELTA  Parameter for the precision check (optional; default: 1e-12)%% OUTPUT% 	OK     1 if the matrix A is symmetric and 0, otherwise.%% DESCRIPTION % A is considered as a symmetric matrix, when it is square and% max(max(A-A')) is smaller than DELTA.%%% Robert P.W. Duin, Elzbieta Pekalska, ela@ph.tn.tudelft.nl% Faculty of Applied Sciences, Delft University of Technology%function [ok,nn] = issym(A,delta)	if nargin < 2, 		prwarning(6,'The precision is not provided, set up to 1e-12.');		delta = 1e-12; 	end	A = +A;	[m,k] = size(A);	if m ~= k,	  error ('Matrix should be square.')	end	nn = max(max((A-A')));	ok = (nn < delta);return;

⌨️ 快捷键说明

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