why ismember() does not return correct result
7 次查看(过去 30 天)
显示 更早的评论
Hello, I have an original matrix M ( Nx3 ) and another one mat ( Kx3 ). I want to have access to the indicies of rows of the original matrix, M, where the rows of the matrix mat also exist in matrix M. My code is:
idx = find(ismember(M, mat, "rows"))
While most of the rows of mat are correctly returned some rows do not. The common theme is that all of them have the third element equal (1.6).
The array mat:
Rows of array M: ( the row [-2.5 1.65 1.6] exists in the array ! )
Is this a floating point problem ?
Thanks
采纳的回答
Star Strider
2023-10-10
They may have very small values that are not shown, especially if they are calculated.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!