- Import the files. (Is this a part of your problem?)
- Search the intersection of the common variable with the command intersect . The 2nd and 3rd output give you the overlapping indices.
Comparison of two unequal length files.
3 ビュー (過去 30 日間)
古いコメントを表示
I have two .csv files of unequal length. each file has two colomns and one has 50000 rows and other has 27000 rows. in this first colomn is of wavelengths and other is of intensity. I want to get data in which the wavelengths of both files are equal and also want corrsponding intensities. so how can i find it using program?
thanking you in advance.
0 件のコメント
採用された回答
Jan
2021 年 3 月 13 日
3 件のコメント
Jan
2021 年 3 月 13 日
編集済み: Jan
2021 年 3 月 13 日
I do not know, how the intensities are represented. Did you mention, if you your data are matrices with a specific number pof columns? A small example would be useful. With some guessing:
A = [1; 3; 2; 17] % 1st file
B = [0, 0.1; 1, 0.2; 2, 0.3; 3 0.4; 17, 0.5; 24, 0.6]; % 2nd file
[Common, iA, iB] = intersect(A, B(:, 1));
CommonIntesity = B(iB, 2)
A(iA, 2) = B(iB, 2) % Maybe wanted...
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Workspace Variables and MAT-Files についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!