FormationControlSimulation/SOURCE/networks-toolbox/isSymmetric.m

11 lines
254 B
Matlab
Raw Normal View History

2019-06-17 14:31:50 +07:00
% Checks whether a matrix is symmetric (has to be square).
%
% INPUTS: adjacency matrix, nxn
% OUTPUTS: boolean variable, {0,1}
%
% GB: last update, Sep 23, 2012
function S = isSymmetric(mat)
S = false; % default
if mat == transpose(mat); S = true; end