display table in command window without { }
    4 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
I just updated my Matlab to 2020b.
I created a table:
tt = table({1;2;3;4;5},{'A';'B';'C';'D';[]},{9;10;11;12;[]},{'E';'F';'G';'H';[]})
In the previous matlab 2018 and lower, it is shown without { }, just the content of the cell. Is it possible to "display" it as before, without the { }?
0 commentaires
Réponses (2)
  Rik
      
      
 le 8 Déc 2021
        If you really want to, you can. The formattedDisplayText function was introduced in R2021a.
tt = table({1;2;3;4;5},{'A';'B';'C';'D';''},{9;10;11;12;nan},{'E';'F';'G';'H';''});
str=formattedDisplayText(tt);
strrep(strrep(str,'{',' '),'}',' ')
2 commentaires
  Walter Roberson
      
      
 le 8 Déc 2021
        No, it is not.
However, if you only need that for display purposes, then 
tt = table({1;2;3;4;5},{'A';'B';'C';'D';''},{9;10;11;12;nan},{'E';'F';'G';'H';''});
TT = varfun(@(V)categorical(string(V)), tt)
Notice I had to change the [] to ' ' or nan 
Voir également
Catégories
				En savoir plus sur Characters and Strings dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


