J******8 发帖数: 132 | 1 The question is not hard. But I missed two key points.
The details below.
==========================================================
/*
example
char *words[] = {"foo", "bar", "baz", NULL};
setup(words);
1) First step:
isMember("foo") -> true
isMember("garply") -> false
2) Second step:
isMember("f.o") -> true
isMember("..") -> false
*/
#include
#include
#include
char *words[] = {"foo", "bar", "baz", "caz","cat",NULL};
int num=0;
void print_words(void)
{
int i=0... 阅读全帖 |
|
t***s 发帖数: 4666 | 2 find(ismember()) operates on a vector too. hehe.
i don't know how ismember is implemented. |
|
t***s 发帖数: 4666 | 3 find(ismember(A,a,'rows')) |
|
b****r 发帖数: 5889 | 4 那这样会快点吗
find(ismember(A',a','column')) |
|
l********a 发帖数: 1154 | 5 这个只能循环吧
a = [1 2;
3 4;
1 2;
1 2;
5 6];
b = [];
for i=1:size(a,1)
if 1==i
restMat = a(2:end,:);
else
restMat = [a(1:i-1,:);a(i+1:end,:)];
end
if ~ismember(a(i,:),restMat,'rows')
b(end+1) = i;
end
end
b |
|
S*********g 发帖数: 5298 | 6 here is a solution
A=[50, 70, 80,60,100,100,70,100];
bb=sort(unique(A));
[ia,ib]=ismember(A,bb)
ib is what you want |
|
|
w*******y 发帖数: 60932 | 8 Offer Valid Nov 28th - Dec4th
$177 + tax
In Store only
This is a North Carolina Ad
Just got my Big Lots ad on the front page a Netbook, not the greatest Specs
but still a low price for anyone that missed out on the Acer one deal last
week.
Link:
http://ads.biglots.com/customer_Frame.jsp?drpStoreID=1806&pageNumber=0&showFlash=false&isMember=1
I know this is not a repost cause I been looking for netbook threads for two
weeks straight.
XP is a little outdated for me and I already bought a netbook s... 阅读全帖 |
|