Mercurial > hg > octave-lyh
diff scripts/general/isvector.m @ 12491:981cd6796065
Use modern warning function rather than deprecated built-in variable to set warning state.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Tue, 01 Mar 2011 11:28:31 -0800 |
parents | fd0a3ac60b0e |
children | 132c89bb44e3 |
line wrap: on
line diff
--- a/scripts/general/isvector.m +++ b/scripts/general/isvector.m @@ -40,19 +40,16 @@ endfunction %!assert(isvector (1)); - %!assert(isvector ([1; 2; 3])); - %!assert(!(isvector ([]))); - %!assert(!(isvector ([1, 2; 3, 4]))); %!test -%! warn_str_to_num = 0; +%! warning ("off", "Octave:str-to-num"); %! assert((isvector ("t"))); %!test -%! warn_str_to_num = 0; +%! warning ("off", "Octave:str-to-num"); %! assert((isvector ("test"))); %!assert(!(isvector (["test"; "ing"]))); @@ -61,7 +58,7 @@ %! s.a = 1; %! assert((isvector (s))); +%% Test input validation %!error isvector (); - %!error isvector ([1, 2], 2);