user2352084
user2352084

Reputation: 135

dlmwrite printing a 3D matrix for every x-dimension line

Currently my matrix has the size of (40x50x60), and when I write it out with dlmwrite, it writes a line for every x and the line is 50*60 long. I need to write the same matrix but the lines should be 40 numbers long. So i just need to divide the long lines with 40 and print a new line after 40 numbers and so on. And the numbers should have the delimiter '\t'.

Right now im using:

dlmwrite('matlaboutput', matrix, '\t')

Is there something I can add to the command or should i use a different command for the result?

Upvotes: 1

Views: 457

Answers (1)

Shai
Shai

Reputation: 114886

You may reshape the matrix to have 40 columns and then write it

dlmwrite('matlaboutput', reshape( matrix, [], 40 ), '\t' );

Upvotes: 2

Related Questions