MATLAB: Table array with numerical row names

numerical rowstables

I'm trying to create a table array where the row names are a vector of doubles, but row names are required to be a cell array of strings. How would someone do this?

Best Answer

Convert your numbers to a cell array of char array (strings are not supported strangely). If the vector of numbers is all integers:
rownames = compose('%d', yourvector);
If it's real numbers then specify the appropriate format string in compose or matlab let do its thing with:
rownames = cellstr(string(yourvector));
Then create your table whichever way you were going to use, e.g.:
t = array2table(somearray, 'RowNames', rownames)