Populate a table (or concatenate a cell array) with various data types
Mostrar comentarios más antiguos
Hi there!
I am stuck with a problem. I would like to display various kind of data into a table in the App Designer. I know I have to put all the data in a cell-array, but I always have multiple errors and I can't do properly the conversions.
For instance, let's say
A = {} % The cell array that contains the data of my table
B = [1 2 3;
4 5 6]
C = {'blabla', 5;
B , struct}
My goal at the end is to obtain
A = {'B' , '' , '' ; % Name of B, I know I can get it by a little function using inputName()
1 , 2 , 3 ;
4 , 5 , 6 ;
'' , '' , '' ; % A blank row for readability
'C' , '' , '' ;
'blabla' , 5 , '' ;
'2x3 double' , '1x1 struct' , '' } % We cannot print these kind of value in one single table cell, so we just indicate their class and size
I suppose I have to use functions such as reshape(), num2cell(), and use A = [A ; {...}] to concatenate my data, and this one induces more problems such as: how to resize in order to match dimensions...
Thank you very much for your help!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Cell Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!