Functions | |
elseif (nargin==2) y | |
else | print_usage () |
!assert (all(abs(pow2(x)-v)< sqrt(eps))) | |
!assert (all(abs(pow2(x, y)-z)< sqrt(eps))) | |
!error | pow2 () |
Variables | |
function | y |
endif endfunction!test | !x = [3, 0, -3] |
!v = [8, 1, .125] | |
!y = [-2, -2, -2, 1, 1, 1, 3, 3, 3] | |
!z = x .* (2 .^ y) |
!assert | ( | all(abs(pow2(x, y)-z)< sqrt(eps)) | ) |
!assert | ( | all(abs(pow2(x)-v)< sqrt(eps)) | ) |
elseif | ( | nargin | = =2 |
) |
!error pow2 | ( | ) |
else print_usage | ( | ) |
!v = [8, 1, .125] |
!test !x = [3, 0, -3] |
!y = [-2, -2, -2, 1, 1, 1, 3, 3, 3] |
!z = x .* (2 .^ y) |