How to combine 2 single column variables in to 1 double column variable and output it to a csv or txt file with a header for each column?
3 次查看(过去 30 天)
显示 更早的评论
I have 2 variables that are 262144 rows by 1 column, variable names are "Freq" and "amp". I'm trying to combine them into a single variable of 262144 rows by 2 columns and have header at the top row of each column output to a txt or csv file. I've been through many answers on here to combine and output the results but i can't seem to make it work for me.
0 个评论
采纳的回答
Dyuman Joshi
2023-4-26
var1 = rand(262144,1);
var2 = rand(262144,1);
T = table(var1,var2,'VariableNames',{'header1', 'header2'});
writetable(T,'filename.csv')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!