Azzera filtri
Azzera filtri

How can i do multi-line UITable cell

5 visualizzazioni (ultimi 30 giorni)
Johnny Birch
Johnny Birch il 13 Mag 2020
Modificato: Johnny Birch il 14 Mag 2020
I am creating a UItable with newline between strings in table cells, for instance "06↵07↵08↵09". How can I have a line shift within a cell in a UITable?
Below is a very simple code example of my issue.
%Prepare data example
Data = {'01','02','03','04','05';'a','b','c','d','e';'','','a1','b2',''};
%preallocate
MainTable = array2table(strings(5,1));
testarray = strings(5,3);
%insert data in testarray
for i = 1:5
for j = 1:3
testarray(i,j) = Data(j,i);
end
end
%prepare array into one column and insert in MainTable
newStr = join(testarray);
newStr = strtrim(newStr);
newStr = strrep(newStr , " ", newline);
MainTable{:,1} = newStr;

Risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Prodotti


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by