How to compare two matrices, row by matrix using the GPU

3 次查看(过去 30 天)
Hi,
given the two matrices A and B I have to create the result matrix, in it we have 1 if the number of the matrix A is contained in the matrix B. We compare the whole matrix A with the elements of each row of the matrix B.
I managed to get the result with cycles but I would need a more efficient function, able to run with the GPU because the rows of the matrix B could be really many.
I thank in advance who will be kind enough to help me.
Thanks
Kurio

采纳的回答

David Hill
David Hill 2020-5-17
Not sure if something like this would work for you.
arrayfun(@(x)ismember(a,b(x,:)),1:size(b,1),'UniformOutput',false);
  1 个评论
kurio curio
kurio curio 2020-5-17
编辑:kurio curio 2020-5-17
Hi, David, I am a beginner and I had never used cells but I learn quickly. Your solution works perfectly, even with the GPU. You are a great. Thanks so much!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 GPU Computing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by