How to write a table of into a binary file

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
Walter Roberson 2015년 9월 2일

0 개 추천

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

JFz
JFz 2015년 9월 3일
Thank you so much! I will I will download. But I do need to read from an Excel file. I want to save the table into a binary file, then read it into an Excel file.
Walter Roberson
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.

댓글을 달려면 로그인하십시오.

카테고리

제품

태그

질문:

JFz
2015년 9월 2일

편집:

2015년 9월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by