Reshape non-even length columns into text output
1 次查看(过去 30 天)
显示 更早的评论
Hi All-
I'm trying to convert some data from one form to another, and have run into trouble. I have a large matrix of data (257 x 257). For each row, I need to write space-separated output so that the first 10 values are on one line, the next 10 on another, etc. This would be fairly easy to do using reshape, except when I get to the last line there are only 7 values remaining, so matlab returns an error.
For example, if I had:
data = [1:13; 14:26];
I would want my output from dlmwrite to be:
1 2 3 4 5 6 7 8 9 10
11 12 13
14 15 16 17 18 19 20 21 22 23
24 25 26
Any advice? I'm using R2011a. Thanks in advance! -sam
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!