Find values of row in matrix
1 次查看(过去 30 天)
显示 更早的评论
so I have matrix and index value I want to get all the values in the row I tried Find & ismember but I didn't get all the values in row 2
matrix = [8 81 82;20 22 23; 3 31 32];
index = 2
find(ismember(matrix,index),1);
采纳的回答
TastyPastry
2015-10-19
matrix(index,:);
ismember(A,B) returns a logical vector true when A is found in B, it doesn't apply here since you're not trying to create a logical mask.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!