writing large 3D .mat file into a .xls file

1 回表示 (過去 30 日間)
Salam
Salam 2013 年 3 月 14 日
I am trying to export a 3D .mat file into an .xls or even a .txt file, but I cant do that as the load/write functions work only for 2D .mat files. The problem is that the file is large (512*512*313) [ I get the 0x800A03EC error]. Excel as far as I know cant handle more than 256 columns, and I cant transpose this directly as it is a 3D array. Any ideas?
  4 件のコメント
Sven
Sven 2013 年 3 月 14 日
Salam, Matt's right... the big question here is what you want to do with the data after it's exported. There are some ways you could represent your 3D data in excel (putting each "page" on a separate spreadsheet, putting each "page" below the previous "page" on a single spreadsheet, etc), but none of these ways will make it very pleasant to deal with the actual excel file.
This isn't a problem that "MATLAB can't export 3D data to excel", it's more a case of "excel isn't well suited to 3D data".
Salam
Salam 2013 年 3 月 14 日
編集済み: Salam 2013 年 3 月 14 日
The .mat file holds some voxel-based data. I need to find certain groupss of voxels/cells and plot the values, analyze the numbers.

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

採用された回答

Sven
Sven 2013 年 3 月 14 日
編集済み: Sven 2013 年 3 月 18 日
Salam,
Here's some code that will at least get your data into excel in some form. You're right that excel has the limitation of 256 columns. Therefore I've fitted each 512-by-512 page into the available space by slicing it in half and storing two 512-by-256 pieces one above the other. I've also chosen to represent the 3rd dimension using different sheets in excel. I'm afraid that this is about the best that can be done when trying to put 3D data into excel:
A = rand(512,512,313);
A_narrow = cat(1, A(:,1:256,:), A(:,257:end,:));
for i = 1:size(A,3)
xlswrite('myfile.xls',A_narrow(:,:,i),['page_' num2str(i)], 'A1')
end
Does this at least run through without error?
  4 件のコメント
Salam
Salam 2013 年 3 月 14 日
I do thank you. If you have any suggested tool other than Excel, I will be thankful.
Sven
Sven 2013 年 3 月 14 日
Ha, my suggestion would be MATLAB ;)
It's really quite well suited to 3D data, and I'd bet that if you can describe clearly what you mean by "analysis on the voxels", there will be plenty of help that you can get right on this forum for how to get MATLAB to perform such analysis.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by