I want to use fprintf to make a table of results
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am using fprintf to make a table of results. I want two separate vectors to be printed in two separated columns (standard in one column and average in other column).
But as you may notice, that is not happening, because the two vectors are being printed in sequence.
I don't know how to solve this.
standard = [7.5156
7.2832
7.2556
6.9506
6.3206
5.8448
5.4522
5.1111
4.8075
4.5315
4.2770
4.0401
3.8186
3.6102
3.4141
3.2290
3.0544
2.8893
2.7330
2.5855
2.4458
2.3139
2.1891
2.0709
1.9591
1.8533
1.7534
1.6588
1.5691
1.4845
1.4042
1.3285
1.2567
1.1890
1.1248
1.0640
1.0067
0.9523
0.9010
0.8524
0.8065
0.7630
0.7218
0.6829
0.6460
0.6110
0.5781
0.5468
0.5173
0.4895
0.4631
0.4381
0.4144
0.3921
0.3709
0.3508
0.3319
0.3140
0.2969
0.2810
0.2658
0.2515
0.2378
0.2250
0.2128
0.2013
0.1905
0.1802
0.1706
0.1615
0.1528
0.1446
0.1368
0.1294
0.1224
0.1158
0.1096
0.1037
0.0980
0.0927
0.0877
0.0828
0.0783
0.0741
0.0701
0.0663
0.0628
0.0595
0.0562
0.0532
0.0504
0.0476
0.0450
0.0424
0.0402
0.0380
0.0360
0.0340
0.0323
0.0306
0.0290
0.0275
0.0259
0.0245
0.0233
0.0221
0.0208
0.0196
0.0186
0.0176
0.0166
0.0157
0.0148
0.0140
0.0133
0.0125
0.0118
0.0110
0.0104
0.0099
0.0094
0.0090
0.0085
0.0082
0.0078
0.0074
0.0070
0.0065
0.0061
0.0059
0.0055
0.0052
0.0050
0.0047
0.0044
0.0042
0.0040
0.0037
0.0034
0.0033];
average = [306.6108
309.0169
311.2043
313.4392
315.6969
317.7413
319.6286
321.3879
323.0361
324.5860
326.0465
327.4248
328.7266
329.9569
331.1200
332.2200
333.2603
334.2444
335.1752
336.0557
336.8886
337.6766
338.4220
339.1273
339.7945
340.4256
341.0227
341.5875
342.1219
342.6274
343.1057
343.5581
343.9861
344.3910
344.7740
345.1364
345.4792
345.8035
346.1104
346.4007
346.6753
346.9351
347.1809
347.4134
347.6334
347.8415
348.0384
348.2247
348.4008
348.5675
348.7252
348.8744
349.0155
349.1490
349.2753
349.3948
349.5078
349.6147
349.7159
349.8116
349.9021
349.9877
350.0687
350.1453
350.2178
350.2864
350.3513
350.4127
350.4708
350.5257
350.5777
350.6269
350.6735
350.7176
350.7593
350.7987
350.8360
350.8713
350.9046
350.9362
350.9661
350.9943
351.0210
351.0462
351.0701
351.0927
351.1141
351.1343
351.1535
351.1716
351.1887
351.2049
351.2202
351.2347
351.2484
351.2614
351.2736
351.2852
351.2962
351.3066
351.3164
351.3258
351.3346
351.3430
351.3509
351.3584
351.3655
351.3722
351.3785
351.3845
351.3902
351.3955
351.4006
351.4054
351.4099
351.4141
351.4181
351.4219
351.4255
351.4289
351.4321
351.4352
351.4381
351.4408
351.4434
351.4459
351.4483
351.4505
351.4526
351.4546
351.4565
351.4582
351.4599
351.4615
351.4630
351.4644
351.4657
351.4670
351.4682
351.4693];
fprintf('=====================================\n')
fprintf('Standard Deviation Average\n')
fprintf('every 10 values every 10 values\n')
fprintf('=====================================\n')
fprintf(' %6.3f %6.3f\n', standard', average')
fprintf('=====================================\n')
0 commentaires
Réponses (1)
Voss
le 16 Mar 2023
Modifié(e) : Voss
le 16 Mar 2023
fprintf(' %6.3f %6.3f\n', [standard, average].')
2 commentaires
Voss
le 17 Mar 2023
Let me run it here... What's wrong with it?
load data.mat % I stored the variables in a mat file to avoid them taking up space here
fprintf('=====================================\n')
fprintf('Standard Deviation Average\n')
fprintf('every 10 values every 10 values\n')
fprintf(' %6.3f %6.3f\n', [standard, average].')
fprintf('=====================================\n')
Voir également
Catégories
En savoir plus sur Tables dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!