source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/lightspeed/ismember_sorted.m @ 86

Last change on this file since 86 was 37, checked in by (none), 15 years ago

Added original make3d

  • Property svn:executable set to *
File size: 858 bytes
Line 
1function [tf,loc] = ismember_sorted(a,s)
2%ISMEMBER_SORTED   True for member of sorted set.
3% ISMEMBER_SORTED(A,S) for the vector A returns an array of the same size as A
4% containing 1 where the elements of A are in the set S and 0 otherwise.
5% A and S must be sorted and cannot contain NaN.
6%
7% [TF,LOC] = ISMEMBER_SORTED(A,S) also returns an index array LOC where
8% LOC(i) is the index in S which matches A(i) (highest if there are ties)
9% or 0 if there is no such index.
10%
11% See also ISMEMBER, MATCH_SORTED, INTERSECT_SORTED, SETDIFF_SORTED, UNION_SORTED.
12
13% Written by Tom Minka
14% (c) Microsoft Corporation. All rights reserved.
15
16% The internal function ismembc comes from ismember.m
17% It requires non-sparse arrays.
18a = full(a);
19s = full(s);
20if nargout < 2
21  tf = ismembc(a,s);
22else
23  loc = ismembc2(a,s);
24  tf = (loc > 0);
25end
Note: See TracBrowser for help on using the repository browser.