So I've got some sets of data and their all columns, such as the example below. As obvious x and y both become column matrices of 11 x 1. I try and get these to print like x(1) y(1)
x(2) y(2)
Which I can
Attempt 4 works for this short example, but with my problem which has lots more values and such it doesnt work, it still prints the values out horizontally. With my problem in my code with lots of data (which I will attatch) it prints out the values, semi correctly, but in a weird kind of way. I am printing some time values then some fitted time values, repeat this 4 times to have a total of 8 arrays of values I am trying to print. So thats why it will go .165 .165. It's all fine up untill the last two columns, the tjohn1 and tf4 (tf4 is the fitted time for john). It prints the intial values of these two columns underneath the first two columns and so the data when printed looks all funky.
Why would It print like this, it's like it's running out of horizontal space in the window and so it jams it underneath the first two columns and how would I fix this?
x = 0:1:10;
x = x'
y = 1:1:11;
y = y'
z =
fprintf('%2.2f | %2.2f \n', [x'; y';])
0.00 | 1.00
1.00 | 2.00
2.00 | 3.00
3.00 | 4.00
4.00 | 5.00
5.00 | 6.00
6.00 | 7.00
7.00 | 8.00
8.00 | 9.00
9.00 | 10.00
10.00 | 11.00
0.165 0.165 0.142 0.142 0.193 0.193
0.129 0.129 1.850 1.825 1.890 1.791
1.940 1.878 1.840 1.810 2.870 2.793
2.880 2.751 2.960 2.866 2.860 2.795
3.780 3.687 3.780 3.637 3.910 3.780
3.800 3.705 4.650 4.555 4.640 4.497
4.780 4.669 4.670 4.590 5.500 5.415
5.470 5.348 5.640 5.549 5.530 5.467
6.320 6.271 6.290 6.195 6.500 6.425
6.380 6.340 7.140 7.125 7.100 7.041
7.360 7.301 7.230 7.212 7.960 7.980
7.920 7.887 8.220 8.177 8.100 8.084
8.790 8.835 8.750 8.733 9.070 9.053
8.960 8.957 9.690 9.690 9.580 9.580
9.930 9.930 9.830 9.830
4 件のコメント
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/601222-fprintf-columns-turning-out-weirdly#comment_1027675
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/601222-fprintf-columns-turning-out-weirdly#comment_1027675
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/601222-fprintf-columns-turning-out-weirdly#comment_1027687
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/601222-fprintf-columns-turning-out-weirdly#comment_1027687
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/601222-fprintf-columns-turning-out-weirdly#comment_1027693
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/601222-fprintf-columns-turning-out-weirdly#comment_1027693
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/601222-fprintf-columns-turning-out-weirdly#comment_1027735
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/601222-fprintf-columns-turning-out-weirdly#comment_1027735
サインインしてコメントする。