Mercurial > hg > octave-lyh
comparison scripts/general/is_vector.m @ 4:b4df021f796c
[project @ 1993-08-08 01:26:08 by jwe]
Initial revision
author | jwe |
---|---|
date | Sun, 08 Aug 1993 01:26:08 +0000 |
parents | |
children | 16a24e76d6e0 |
comparison
equal
deleted
inserted
replaced
3:9a4c07481e61 | 4:b4df021f796c |
---|---|
1 function retval = is_vector (x) | |
2 | |
3 # usage: is_vector (x) | |
4 # | |
5 # Return 1 if the either the number of rows (columns) of x is 1 and | |
6 # the number of columns (rows) is greater than one. Otherwise, return 0. | |
7 # | |
8 # See also: size, rows, columns, length, is_scalar, is_matrix | |
9 | |
10 if (nargin == 1) | |
11 [nr, nc] = size (x); | |
12 retval = ((nr == 1 && nc > 1) || (nc == 1 && nr > 1)); | |
13 else | |
14 error ("usage: is_vector (x)"); | |
15 endif | |
16 | |
17 endfunction |