Write multiple vectors into .dat file

I have been working with some data from a recent experiment and would like to move the data into a .dat file. However I have multiple vectors and require them in the same file.
Say I have the vectors:
x = [1, 2, ...];
y = [3, 4, ...];
How would I go about doing this?

 採用された回答

dpb
dpb 2020 年 2 月 23 日

1 投票

Simplest, presuming they're the same length would be to write as 2D array. I'd write as column instead of row..
writematrix([x.' y.'],'yourNewDataFile.dat');
will write a csv file with default precision.
See documentation for more options.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLarge Files and Big Data についてさらに検索

質問済み:

2020 年 2 月 23 日

回答済み:

dpb
2020 年 2 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by