array to csv separated by commas

I have two large arrays(nx1 and nx1) of same size, I want to create a csv file where the arrays(column) separated by comma. It should be like array1(i),array2(i). It should be finally single array (nx1) with comma separated entries
I tried csvwrite, but its doing math operation between the numbers, which I dont want.
Thanks in advance

回答 (1 件)

Image Analyst
Image Analyst 2020 年 4 月 24 日

0 投票

It should not be doing math unless you told it to do math. You should be able to just do
m = [array1, array2];
writematrix(m, 'data.csv'); % Or csvwrite if you have an old version of MATLAB.

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

タグ

質問済み:

2020 年 4 月 24 日

回答済み:

2020 年 4 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by