Find values of row in matrix

2 ビュー (過去 30 日間)
will99
will99 2015 年 10 月 19 日
回答済み: TastyPastry 2015 年 10 月 19 日
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);
  1 件のコメント
will99
will99 2015 年 10 月 19 日
編集済み: will99 2015 年 10 月 19 日
I found solution ^^ but please suggest other ways if there is one
matrix(index,:);

サインインしてコメントする。

採用された回答

TastyPastry
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 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by