Last change
on this file since 177 was
37,
checked in by (none), 15 years ago
|
Added original make3d
|
-
Property svn:executable set to
*
|
File size:
858 bytes
|
Rev | Line | |
---|
[37] | 1 | function [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.
|
---|
| 18 | a = full(a);
|
---|
| 19 | s = full(s);
|
---|
| 20 | if nargout < 2
|
---|
| 21 | tf = ismembc(a,s);
|
---|
| 22 | else
|
---|
| 23 | loc = ismembc2(a,s);
|
---|
| 24 | tf = (loc > 0);
|
---|
| 25 | end
|
---|
Note: See
TracBrowser
for help on using the repository browser.