Functions | |
if (nargin==1) if(ismatrix(x)&&ndims(x)< 3)[nr | |
if (nr==nc &&nr > 0) retval | |
endif endif else | print_usage () |
endif endfunction | !assert (issquare(1)) |
!assert (!(issquare([1, 2]))) | |
!assert (!(issquare([]))) | |
!assert (issquare([1, 2;3, 4])==2) | |
!assert (!(issquare("t"))) | |
!assert (!(issquare("test"))) | |
!assert (!(issquare(["test";"ing";"1";"2"]))) | |
!assert (!(issquare(s))) | |
!assert (!(issquare([1, 2;3, 4;5, 6]))) | |
!error | issquare () |
!error | issquare ([1, 2;3, 4], 2) |
Variables | |
function | retval |
nc = size (x) | |
!test | !warn_str_to_num = 0 |
!test!s | a = 1 |
!assert | ( | ! | issquare([1, 2;3, 4;5, 6]) | ) |
!assert | ( | ! | issquare(s) | ) |
!assert | ( | ! | issquare(["test";"ing";"1";"2"]) | ) |
!assert | ( | ! | issquare("test") | ) |
!assert | ( | ! | issquare("t") | ) |
!assert | ( | issquare([1, 2;3, 4]) | = =2 |
) |
!assert | ( | ! | issquare([]) | ) |
!assert | ( | ! | issquare([1, 2]) | ) |
endif endfunction !assert | ( | issquare(1) | ) |
if | ( | nargin | = = 1 |
) |
!error issquare | ( | 2 | ) |
!error issquare | ( | ) |
!test !warn_str_to_num = 0 |
!test ! s a = 1 |
nc = size (x) |