Functions | |
elseif (isempty(x)) y | |
endif else | error ("logical not defined for type `%s'", typeinfo(x)) |
endif else | print_usage () |
endif endfunction | !assert (logical([]), zeros([0, 0],"logical")) |
!assert (logical(zeros(2, 0)), zeros([2, 0],"logical")) | |
!assert (logical(0), false) | |
!assert (logical(13), true) | |
!assert (logical(-13), true) | |
!assert (logical(int8(13)), true) | |
!assert (logical(int8(-13)), true) | |
!assert (logical([-1, 0, 1, Inf]),[-1, 0, 1, Inf]!=0) | |
Variables | |
function | y |
!assert | ( | logical([-1, 0, 1, Inf]) | , | |
[-1, 0, 1, Inf] ! | = 0 | |||
) |
!assert | ( | logical(int8(-13)) | , | |
true | ||||
) |
!assert | ( | logical(int8(13)) | , | |
true | ||||
) |
!assert | ( | logical(-13) | , | |
true | ||||
) |
!assert | ( | logical(13) | , | |
true | ||||
) |
!assert | ( | logical(0) | , | |
false | ||||
) |
!assert | ( | logical(zeros(2, 0)) | , | |
zeros([2, 0],"logical") | ||||
) |
endif endfunction !assert | ( | logical([]) | , | |
zeros([0, 0],"logical") | ||||
) |
elseif | ( | isempty(x) | ) |
elseif (isnumeric (x)) if (any (isnan (x( else y |