- 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 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Devang Anadkat
el 13 de Mzo. de 2021
Comentada: Devang Anadkat
el 13 de Mzo. de 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 comentarios
Respuesta aceptada
Jan
el 13 de Mzo. de 2021
3 comentarios
Jan
el 13 de Mzo. de 2021
Editada: Jan
el 13 de Mzo. de 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...
Más respuestas (0)
Ver también
Categorías
Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!