call vector in matrix with condition?

Let's say:
A=[1 2 3 10;4 5 6 15;7 8 9 20]
A=
1 2 3 10
4 5 6 15
7 8 9 20
B=[5 6 15;8 9 20]
B=
5 6 15
8 9 20
I want to call array C from A & B. How can?
C=[4;7]

2 件のコメント

Guillaume
Guillaume 2018 年 3 月 21 日
What does call array C from A & B actually mean?
You need to explain why C is 2x1 and not some other size, and where the 4 and 7 are derived from A and B.
ha ha
ha ha 2018 年 3 月 21 日
@Guillaume . I just want to call the value from first column in matrix A, If the matrix in column 2:4 in A is equal to matrix B, respectively

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

 採用された回答

ha ha
ha ha 2018 年 3 月 21 日

0 投票

A(ismember(A(:,2:4),B,'rows'),1);

1 件のコメント

M
M 2018 年 3 月 21 日
How does this correspond to A & B ?

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeOperators and Elementary Operations についてさらに検索

タグ

質問済み:

2018 年 3 月 21 日

コメント済み:

2018 年 3 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by