- You can set the Data to a numeric array, in which case each array element will be made into a separate entry, same as if you had set the data to num2cell() of the numeric array
- You can set the Data to a cell array. Each entry in the cell array must be either a numeric scalar or a logical scalar or a string() scalar or a character (row) vector. It is not possible to set an entry to be a 1 x 2 numeric array.
Problem with Table exportation!
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Panos Ale
am 16 Jan. 2018
Kommentiert: Panos Ale
am 17 Jan. 2018
Hallo! I have this table wich consists of two columns one singe(AlplaParameter) and one double(ConfidenceInt)

I used this command in order export the table as figure
uitable('Data',T{:,:},'ColumnName',T.Properties.VariableNames,'RowName',T.Properties.RowNames,'Units', 'Normalized', 'Position',[0, 0, 1, 1]);
Unfortunatelly, the second column is transformed to two single columns leaving the column name empty. Here is a picture that illustates the problem:

How can I merge the title cells of 2nd and 3rd column?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 16 Jan. 2018
That is not possible with uitable.
The closest you could get to this is to convert the entries for the dual column into character, such as
data = [num2cell(YourTable.AlpaParameter), cellstr(num2str(YourTable.ConfidenceInt))];
uitable(...', 'Data', data)
6 Kommentare
Walter Roberson
am 17 Jan. 2018
Is it possible that you changed the font for the uitable to something that is proportionally spaced?
The code I gave,
data2 = sprintfc('<HTML><table border=0 width=150><td><CENTER>%10.4f %10.4f', YourTable.ConfidenceInt);
puts spaces in in the middle, both by the blanks and because the %10.4f format is larger than is needed for that data. Did you possibly change that code?
Weitere Antworten (1)
Panos Ale
am 17 Jan. 2018
3 Kommentare
Walter Roberson
am 17 Jan. 2018
Very odd... The spacing does show up if the ColumnWidth has been left 'auto' and you have not changed the width by attempting to drag it. Unfortunately in that combination, the second column is cut off because 'auto' is not wide enough to hold all of the information. As soon as you change the width of the second column, the spacing disappears!
I do not understand at the moment why this is happening. It will require more exploration.
Siehe auch
Kategorien
Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!