Functions | |
elseif (nargin!=2) print_usage() | |
endif | if (isvector(c)) retval |
endfor else | error ("vander: argument must be a vector") |
!assert (expect, result) | |
!assert ((vander(1)==1 &&vander([1, 2, 3])==vander([1;2;3])%!&&vander([1, 2, 3])==[1, 1, 1;4, 2, 1;9, 3, 1]%!&&vander([1, 2, 3]*i)==[-1, i, 1;-4, 2i, 1;-9, 3i, 1])) | |
!assert (vander(2, 3),[4, 2, 1])%!assert(vander([2 | |
!error | vander ([1, 2;3, 4]) |
!error | vander (1, 2, 3) |
Variables | |
function | retval |
d = 1 | |
c = c(:) | |
for | i |
endif endfunction!test | !c = [0,1,2,3] |
!expect = [0,0,0,1 | |
!result = vander(c) |
!assert | ( | vander(2, 3) | ) |
!assert | ( | (vander(1)==1 &&vander([1, 2, 3])==vander([1;2;3])%!&&vander([1, 2, 3])==[1, 1, 1;4, 2, 1;9, 3, 1]%!&&vander([1, 2, 3]*i)==[-1, i, 1;-4, 2i, 1;-9, 3i, 1]) | ) |
!assert | ( | expect | , | |
result | ||||
) |
elseif | ( | nargin! | = 2 |
) |
endif if | ( | isvector(c) | ) |
!error vander | ( | 1 | , | |
2 | , | |||
3 | ||||
) |
error vander | ( | ) |
endif endfunction !test !c = [0,1,2,3] |
!expect = [0,0,0,1 |
!result = vander(c) |
c = c(:) |
d = 1 |