Functions | |
endif | if (nargin==2)[idx |
idx (idx2) | |
d (idx2) | |
!assert (dsearchn(x, tri,[1, 1/3]), 3) | |
!assert (dsearchn(x, tri,[1, 1/3], NaN), NaN) | |
!assert (dsearchn(x, tri,[1, 1/3], NA), NA) | |
!assert (dsearchn(x, tri,[1/3, 1]), 2) | |
!assert (dsearchn(x, tri,[1/3, 1], NaN), NaN) | |
!assert (dsearchn(x, tri,[1/3, 1], NA), NA) | |
Variables | |
function [idx, d] | |
endif | d = __dsearchn__ (x, t) |
else [idx, d] = __dsearchn__ (x, xi) | |
endif endif endfunction!shared | x |
endif endif endfunction!shared tri | !x = [-1,-1 |
!tri = [1,2,3] |
!assert | ( | dsearchn(x, tri,[1/3, 1], NA) | , | |
NA | ||||
) |
!assert | ( | dsearchn(x, tri,[1/3, 1], NaN) | , | |
NaN | ||||
) |
!assert | ( | dsearchn(x, tri,[1/3, 1]) | , | |
2 | ||||
) |
!assert | ( | dsearchn(x, tri,[1, 1/3], NA) | , | |
NA | ||||
) |
!assert | ( | dsearchn(x, tri,[1, 1/3], NaN) | , | |
NaN | ||||
) |
!assert | ( | dsearchn(x, tri,[1, 1/3]) | , | |
3 | ||||
) |
d | ( | idx2 | ) |
idx | ( | idx2 | ) |
!tri = [1,2,3] |
endif endif endfunction !shared tri !x = [-1,-1 |
endif d = __dsearchn__ (x, t) |
function[idx, d] |
endif endif endfunction !shared x |