Clear Filters
Clear Filters

How to combine two data file in one file?

7 views (last 30 days)
I am trying to combine two data file. For example I have I data 2345 in one file and Q data -234 in second file and want to put together in one file in format 2345, -234
  2 Comments
Jonas
Jonas on 2 Apr 2024
most often you can combine it. how exactl depends on the data files. please provide two exemplary data files
Durgendra
Durgendra on 2 Apr 2024
I have data generated from fromat below:
2756.00000000000 - 1252.00000000000i 2681.00000000000 - 992.000000000000i 2540.00000000000 - 679.000000000000i 2346.00000000000 - 330.000000000000i 2113.00000000000 + 37.0000000000000i 1860.00000000000 + 403.000000000000i 1602.00000000000 + 750.000000000000i 1357.00000000000 + 1058.00000000000i 1140.00000000000 + 1312.00000000000i 965.000000000000 + 1495.00000000000i
I am using below commond
IQ_data = data;
dlmwrite('IQ_data.txt', IQ_data, 'delimiter','\n')
I_data = real(IQ_data);
Q_data = imag(IQ_data);
Now how to combine data like below
2756,-1252
2681,-992
2540,-679
2346,-330
2113,37
1860,403
1602,750
1357,1058

Sign in to comment.

Accepted Answer

Mathieu NOE
Mathieu NOE on 2 Apr 2024
hello
try this :
IQ_data = [2756.00000000000 - 1252.00000000000i
2681.00000000000 - 992.000000000000i
2540.00000000000 - 679.000000000000i
2346.00000000000 - 330.000000000000i
2113.00000000000 + 37.0000000000000i];
I_data = real(IQ_data);
Q_data = imag(IQ_data);
writematrix([I_data Q_data], 'IQ_data.txt')
% plot data stored in file IQ_data.txt
type IQ_data.txt
2756,-1252 2681,-992 2540,-679 2346,-330 2113,37

More Answers (0)

Categories

Find more on Data Import and Analysis in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!