Mercurial > octave-nkf
view scripts/general/is_square.m @ 78:0fda6e1f90e0
[project @ 1993-08-30 15:40:16 by jwe]
author | jwe |
---|---|
date | Mon, 30 Aug 1993 15:40:48 +0000 |
parents | 98eb51c870b2 |
children | 16a24e76d6e0 |
line wrap: on
line source
function retval = is_square (x) # usage: is_square (x) # # If x is square, then return value is the dimension of x. # otherwise, returns a value of 0 # # See also: size, rows, columns, length, is_matrix, is_scalar, is_vector # Written by A. S. Hodel (scotte@eng.auburn.edu) August 1993. if (nargin == 1) [nr, nc] = size (x); if (nr == nc) retval = nr; else retval = 0; endif else error ("usage: is_square (x)"); endif endfunction