How can I generate a map key for this vector in MATLAB?

前端 未结 3 1700
名媛妹妹
名媛妹妹 2021-01-18 23:39

I have a function that is looking at a number of elements. Each element is of the form of an 8x1 column vector. Each entry in the vector is an integer less than 1000. Every

3条回答
  •  不要未来只要你来
    2021-01-19 00:37

    Not really into hashing, but still believe to have found the simplest way to solve your problem.

    This runs about 10x faster than ismember.

    any(v(1)==M(1)&v(2)==M(2)&v(3)==M(3)&v(4)==M(4)&v(5)==M(5)&v(6)==M(6)&v(7)==M(7)&v(8)==M(8));
    

提交回复
热议问题