Printing 3D multidimensional array on a file

3 views (last 30 days)
Edgar
Edgar on 13 May 2013
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?

Answers (1)

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

Sign in to comment.

Categories

Find more on Data Import and Export in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!