How to write a table of into a binary file
3 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a table of many rows full of strings. How to write the table into a binary file by fwrite. I know how to write if it is numbers, but not if it is full of strings.
Thanks,
Jennifer
回答(1 个)
Walter Roberson
2015-9-2
fid = fopen('YourOutputFile', 'w'); %not 'wt' !!
fwrite(fid, hlp_serialize(YourTable) );
fclose(fid);
Note: this answer assumes that you have given up your requirement from your previous question that the data be readable from Excel VBA code. Tables are a MATLAB object-oriented data structure that has no direct Excel equivalent, so if you needed the table to be readable from Excel VBA you would need to define the set of properties that need to be preserved and you would need to define limits on the varieties of MATLAB Tables that need to be represented.
2 个评论
Walter Roberson
2015-9-5
编辑:Walter Roberson
2015-9-5
You need to define the set of properties that need to be preserved and you need to define limits on the varieties of MATLAB Tables that need to be represented.
You also need to investigate on the VBA side what you need to do to create the table structure that you need for whatever processing you are planning to do.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!