From 6a87779d9e91c0970e79443c6b6c020f96d39a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Thu, 4 Oct 2018 23:17:49 +0200 Subject: [PATCH] Cosmetic change. --- matlab/utilities/general/isquare.m | 36 +++++++++--------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/matlab/utilities/general/isquare.m b/matlab/utilities/general/isquare.m index 693417c35..edd2ad1ab 100644 --- a/matlab/utilities/general/isquare.m +++ b/matlab/utilities/general/isquare.m @@ -1,28 +1,14 @@ function info = isquare(A) -%@info: -%! @deftypefn {Function File} {@var{info} =} isquare (@var{A}) -%! @anchor{isquare} -%! @sp 1 -%! Tests if @var{A} is square matrix. -%! @sp 2 -%! @strong{Inputs} -%! @sp 1 -%! @table @ @var -%! @item A -%! Matlab's array. -%! @end table -%! @sp 2 -%! @strong{Outputs} -%! @sp 1 -%! @table @ @var -%! @item info -%! Integer scalar equal to 1 if @var{A} is a square matrix, 0 otherwise. -%! @end table -%! @end deftypefn -%@eod: +% Returns true iff A is a square matrix. +% +% INPUTS +% - A [double] matrix. +% +% OUTPUTS +% - info [logical] -% Copyright (C) 2013-2014 Dynare Team +% Copyright (C) 2013-2018 Dynare Team % % This file is part of Dynare. % @@ -39,7 +25,7 @@ function info = isquare(A) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -info = 0; -if isequal(ndims(A),2) && isequal(size(A,1),size(A,2)) - info = 1; +info = false; +if ismatrix(A) && isequal(size(A, 1), size(A, 2)) + info = true; end \ No newline at end of file