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?
0 个评论
回答(1 个)
Matt J
2013-5-13
data=mat2tiles(matrix,[154,256,1]);
dlmwrite('matlaboutput', vertcat(data{:}), '\t')
10 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Export 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!