How to build a table with words and numbers?
Show older comments
Dear All, I am having hard time trying to build a table on MATLAB that consists of words and numbers, the numbers I have them as vectors but I need to add the labels, what is the best way to do that? I attached the small table I am trying to make.
2 Comments
Walter Roberson
on 11 Apr 2019
When you say you want to build a table, please indicate which of these you are trying to do:
- Create a .xls or .xlsx file that has a mix of text and numbers in the cells
- Create a uitable graphics object that has a mix of text and numbers in the cells
- Create a cell array that has a mix of text and numbers in the cells
- Create a numeric array that has a mix of text and numbers
- Create a table() object that has a mix of text and numbers in the entries (if so, is it acceptable to use JAN FEB and so on as the names of the variables?)
- Create some kind of array that is not numeric and not a cell array or table() object but when you use regular () indexing of it, then indexing at column 1 or row 1 should give text objects but regular () indexing of the other rows and columns should give numeric results
- Display as text in the command window a nicely aligned display that has a mix of text and numbers in it
- Write as a text file a nicely aligned display that has a mix of text and numbers in it
- Display on a plot a nicely aligned display that has a mix of text and numbers in it
Most of these are possible, but not all of them. You cannot (usefully) put text into a numeric array. Creating an array that is not numeric or cell array or table object in which () indexing is intelligent about what it returns would require writing a new kind of data class that might not be compatible with most existing numeric uses.
MAHMOUD ALZIOUD
on 12 Apr 2019
Accepted Answer
More Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!