export/import arbitrary data as text

조회 수: 3 (최근 30일)
John
John 2016년 3월 3일
댓글: John 2016년 3월 3일
I am looking for a way to convert arbitrary array data (not structs) into a text format suitable for storage as a text field in a database, and the inverse function to read that data back into Matlab. The ideal solution would permit >2D arrays, and deal with cell, char, and all numeric data types, losing as little precision as possible.
I am currently converting such data into a binary blob, but this limits access to the data to Matlab, and I'm getting a lot of pressure for Python and other languages to be supported. This means the solution must be a string that can be converted by those other languages as well as created by them.
I can think of relatively easy solutions to 2D arrays, but if someone has already written an N-D solution that would be marvelous.
Thanks.
  댓글 수: 2
Walter Roberson
Walter Roberson 2016년 3월 3일
Would XML work?
John
John 2016년 3월 3일
If it is text that can handle N-dimensional numeric data in all formats and NxM character cell data, export it and then reimport it without change, yes. I had not thought of XML, but I'll look see. Thanks.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by