Is it possible to save . mat <4095x1384x2 double> file to txt file?

1 回表示 (過去 30 日間)
Petricek
Petricek 2014 年 3 月 4 日
回答済み: Iain 2014 年 3 月 4 日
Is it possible to save 4095x1384x2 double . mat file to txt file?
I have tried this but it didnt work. >> save file.txt data -ascii -double -tabs Warning: Attempt to write an unsupported data type to an ASCII file. Variable 'data' not written to file.
  3 件のコメント
Petricek
Petricek 2014 年 3 月 4 日
Name Size Bytes Class Attributes
data 4095x1372x2 89893440 double
Thomas
Thomas 2014 年 3 月 4 日
its because it is three dimensional.. It needs the data to be two dimensional to save double

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

回答 (2 件)

Thomas
Thomas 2014 年 3 月 4 日
You can save it as slices
data1=data(:,:,1);
data2=data(:,:,2);
and then save or he alternative would be to use reshape to make it a 2D matrix and save it, and when you load it, reshape it back to a 3D matrix.

Iain
Iain 2014 年 3 月 4 日
Yes. You can most certainly save something that big to text file. I wouldn't say that is sensible.
There are three reasons for this:
1. Your data is huge (90MB) and as text, I'd expect it to be more than that. 2. It'll take ages to write. 3. How do you want to arrange your data? Its a 3-D table, at best, text gives you a simple 2-d table
A simple method for getting the data into a text file, is actually to use the "diary" function, (which makes everything printed to screen go straight into a text file), then just make your variable print to screen. The data will not be sensibly arranged, and it will be hard to read, but it'll be in a file which someone can eventually decide to read. .

カテゴリ

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