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
0 个评论
采纳的回答
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);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 GPU Computing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!