fprintf using a for loop
Afficher commentaires plus anciens
Hello,
I seem to be having trouble figuring out how to make a table using fprintf using a for loop.
I currently have one cell array and 3 row vectors defined as such:
C = {’a’, ’bb’, ’ccc’, ’dddd’, ’eeeee’};
x = [6.715, -12.075, 7.172, 16.302, 4.889];
y = [-134.98869, 303.49235, 72.54042, -6.30549, 71.47429];
z = [14380, 0.00325, -7549, 13700, -0.00017];
My task is to create a table using fprintf that looks exactly like the following:
x C y C z
---------------------------------------------------
6.715 a -134.98869 a +1.438E+004
-12.075 bb 303.49235 bb +3.250E-003
7.172 ccc 72.54042 ccc -7.549E+003
16.302 dddd -6.30549 dddd +1.370E+004
4.889 eeeee 71.47429 eeeee -1.700E-004
Any help would be appreciated. Thanks.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur App Building dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!