MAC: Write numberical dataset with string header row to .csv

2 ビュー (過去 30 日間)
Cody Miller
Cody Miller 2016 年 6 月 11 日
回答済み: Walter Roberson 2016 年 6 月 11 日
I know this has topic has been broached in the PC world, so I apologize if this has been successfully addressed for MAC. I have seen a few convoluted options, though I have been unsuccessful in getting them functional for me.
I am attempting to write a dataset to a .csv file. This is a numeric matrix with a string header. I have made various attempts with csvwrite, dlmwrite, export, etc. I understand there are issues with MAC contacting Excel, but I wonder if there is a simple, elegant work around for this issue? Perhaps something I am missing?
Sorry, I know this is woe-fully rudimentary.

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 6 月 11 日
fopen() the output file and fprintf() the header into it. After that you have two choices:
1) continue onwards by using fprintf() to write out the numeric part, and then fclose() the file; or
2) fclose the file, and then use dlmwrite() with the append option to write the numeric part.

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by