Merging real and imaginary data in to one variable
2 views (last 30 days)
Show older comments
Hi,
I am trying to merge 2 csv files with frequency response in to one as "freq, real data1, imag data1, real data2, imag data2 etc..." format. One file contains "freq, real data1, real data2, real data3, etc..." and other file contains "freq, Imag data1, Imag data2, Imag data3, etc..." format.
Since this is a stastical sim, each file have about 4096 columns and doing it by hand is time consuming. I am sure there should be easy way to write script and combine it.
Please provide guidance.
Thanks.
2 Comments
Accepted Answer
David Hill
on 4 May 2022
R=readmatrix('yourData1.csv');%assuming the sizes are the same
I=readmatrix('yourData2.csv');
newMatrix=[R(:,2:end);I(:,2:end)];
newMatrix=[R(:,1),reshape(newMatrix,size(R,1),[])];
0 Comments
More Answers (0)
See Also
Categories
Find more on Design and Simulate SerDes Systems 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!