How to display more than 3 elements per column using the Matlab "table" command?
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
When using the table command in Matlab, variables with a vector size bigger than 3 would not be displayed in the table with their actual values. Instead I get something like [1x4 double].
Please see this Matlab help example, I adapted to show my issue:
Case with vector length in variable "BloodPressure" = 3 (output displayed as "124 93 1" - the values I'm looking for)
LastName = {'Smith';'Johnson';'Williams';'Jones';'Brown'};
Age = [38;43;38;40;49];
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
BloodPressure = [124 93 2; 109 77 2; 125 83 2; 117 75 2; 122 80 2222222222];
T = table(Age,Height,Weight,BloodPressure,...
'RowNames',LastName)
Command window:
T =
Age Height Weight BloodPressure
___ ______ ______ _______________________________
Smith 38 71 176 124 93 2
Johnson 43 69 163 109 77 2
Williams 38 64 131 125 83 2
Jones 40 67 133 117 75 2
Brown 49 64 119 122 80 2.2222e+09
Case with vector length in variable "BloodPressure" = 4 (output displayed as [1x4 double] - this is not of use for me)
LastName = {'Smith';'Johnson';'Williams';'Jones';'Brown'};
Age = [38;43;38;40;49];
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
BloodPressure = [124 93 1 2; 109 77 1 2; 125 83 1 2; 117 75 1 2; 122 80 1 2222222222];
T = table(Age,Height,Weight,BloodPressure,...
'RowNames',LastName)
Command window:
T =
Age Height Weight BloodPressure
___ ______ ______ _____________
Smith 38 71 176 [1x4 double]
Johnson 43 69 163 [1x4 double]
Williams 38 64 131 [1x4 double]
Jones 40 67 133 [1x4 double]
Brown 49 64 119 [1x4 double]
Any hints and help much appreciated!
0 commentaires
Réponses (1)
Peter Perkins
le 13 Mai 2015
bayleaf, there's not currently any way to do that, other than splitting the four (or more) columns into separate variables in the table.
Can you say more about what you're doing, and why?
1 commentaire
Voir également
Catégories
En savoir plus sur Tables dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!