Printing 3D multidimensional array on a file

4 次查看(过去 30 天)
I have a 3D multidimensional array and i need to write it to a text file. The model is 154x256x70 and i need the file to have lines that have 256 numbers on them each and separated with TAB or space.
So far I've used the command: dlmwrite('matlaboutput', reshape (matrix, [], 256), '\t')
But it doesn't seem to give the right output. It does give the numbers, but they seem to be mixed.
Is the command wrong for a 3D matrix or the command doesn't work that way?
And wich command should I use instead?

回答(1 个)

Matt J
Matt J 2013-5-13
data=mat2tiles(matrix,[154,256,1]);
dlmwrite('matlaboutput', vertcat(data{:}), '\t')
  10 个评论
Edgar
Edgar 2013-5-13
Nmax=ndims(chestCond);
chestCond is the name of my 3D multidimensional array
Matt J
Matt J 2013-5-13
I do not see a call to mat2tiles in this statement.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Data Import and Export 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by