- 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 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Devang Anadkat
il 13 Mar 2021
Commentato: Devang Anadkat
il 13 Mar 2021
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 Commenti
Risposta accettata
Jan
il 13 Mar 2021
3 Commenti
Jan
il 13 Mar 2021
Modificato: Jan
il 13 Mar 2021
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...
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Workspace Variables and MAT-Files in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!