How to match array data and excel data?

4 ビュー (過去 30 日間)
Nilna Almumtazah
Nilna Almumtazah 2022 年 12 月 19 日
コメント済み: Nilna Almumtazah 2022 年 12 月 23 日
I have array data and excel data. I want to match my array data with excel data. For example, I want array data 'I' to match with excel data 'B'. If all contents of data 'I' match all columns in a particular row of data 'B', then the output result is data 'A' in the same row as data 'B'. I will be appreciated if someone guides me. Thank you
I = [0.0673 22.8800 4.5213e+03 2.1387e+03 12.4245 0.6936 3.7715 0.0474 0.2561 16.0428 82.6339];
Data 'B'
Data 'A'
  5 件のコメント
Nilna Almumtazah
Nilna Almumtazah 2022 年 12 月 20 日
I want to retrieve the row number, provided that the column value matches data 'I'.

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

回答 (1 件)

prasanth s
prasanth s 2022 年 12 月 20 日
if all data type is in array type,
the matching row positions can be obtained using
rows=all(B==I,2)
contents from 'A' obtained using
data=A(rows,:);
  4 件のコメント
Nilna Almumtazah
Nilna Almumtazah 2022 年 12 月 23 日
OK, thanks for both of your answers

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

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by