フィルターのクリア

How to convert .mat to .txt?

12 ビュー (過去 30 日間)
giancarlo maldonado cardenas
giancarlo maldonado cardenas 2022 年 2 月 23 日
コメント済み: Benjamin Thompson 2022 年 2 月 24 日
Hi friends.
I have a problem, how can I convert my Datase.mat matlab file to .txt to send to a friend, because this friend doesn't have matlab and he needs to see what the Dataset.mat file contains.
And within this dataset.mat file there are nested structures.
I attach the Dataset.mat file
Thanks in advance
  1 件のコメント
Walter Roberson
Walter Roberson 2022 年 2 月 24 日
What part of it does he need to see? Your file includes struct and includes cell array of struct, and includes some arrays with several thousand entries. You would have to transfer in a way that your friend could read.
For example, you might be able to use jsonencode() on a modified version of the data. Not an exact version, because your data includes complex numbers, which json does not support; you would have to either convert those to string or convert to real() and imag() lists. Also, your radius is a 1 x 10 cell array, each element of which is a scalar double, and jsonencode converts that as-if it were a plain 1 x 10 vector of double.
Does your friend have to know the exact details of the data, or are only some variables needed, or would it be acceptable to do things like split into real and imaginary components?

サインインしてコメントする。

回答 (1 件)

Benjamin Thompson
Benjamin Thompson 2022 年 2 月 24 日
You can save variables from MATLAB to text using writematrix. Older versions of this are called csvwrite or dlmwrite.
  4 件のコメント
giancarlo maldonado cardenas
giancarlo maldonado cardenas 2022 年 2 月 24 日
How can i solve this problem?
Benjamin Thompson
Benjamin Thompson 2022 年 2 月 24 日
For converting structures to text, see examples in the File Exchange such as this one:
I used one of these in a project in the past, it was quite effective. Many browsers and some applications have support for displaying XML.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLTE Toolbox についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by