Doubles and cell array in uitable
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
cdr
el 21 de Abr. de 2015
trying to get variable double arrays and one (1xn) cell array in an uitable.
Error: Error using uitable Values within a cell array must be numeric, logical, or char
if i try to convert it i get the following error:
Error: data within a cell array must have size [1 1]
that´s my data and uitable:
dat = [double1' double2' 1xNcell double3'];
f = figure('Position',[100 100 1000 500]);
columnformat = {'numeric','numeric',{'c' 'd'},'numeric'};
cnames = {'1','2', 'string','3'};
t = uitable('Parent',f, 'ColumnName',cnames, 'Position',[25 50 950 450],'Data', dat)
Can someone help me out?
0 comentarios
Respuesta aceptada
Image Analyst
el 21 de Abr. de 2015
columnformat is a cell array. Three of the 4 cells in columnformat are simple strings. However the third cell contains another cell . Why? It should not. Have you read the FAQ: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F
Also, in this line
dat = [double1' double2' 1xNcell double3'];
that won't work if 1xNcell is really a cell array instead of a double array like the other 3. I recommend you split your data up into all doubles, or if you need mixed class data, use one cell array for dat. Either way, you should not have a cell within a cell for columnformat.
1 comentario
Más respuestas (0)
Ver también
Categorías
Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!