export a variable to multiple csv files

7 ビュー (過去 30 日間)
novice modeler
novice modeler 2017 年 5 月 4 日
回答済み: dpb 2017 年 5 月 4 日
Friends, I have a variable with four columns. Although I can export it in a single csv file, what I have to do, if I want to export the four columns in two csv files, each containing two columns. Attached is a sample variable.

採用された回答

dpb
dpb 2017 年 5 月 4 日
csvwrite('file1.csv',x(:,1:2))
csvwrite('file2.csv',x(:,3:4))
File names and subscript expressions can all be variables under programmatic control, of course. All you have to do is know what it is you need/want where...

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT Files についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by