Matlab cell2mat error
Mostrar comentarios más antiguos
Hi,
I have a following error when I use Matlab 2012b and 2016a. "Error using cell2mat (line 52) CELL2MAT does not support cell arrays containing cell arrays or objects." However, I do not have this error in Matlab 2014a. Does anyone have idea why this happens?
Thank you
5 comentarios
Steven Lord
el 7 de Nov. de 2016
Can you post a small sample of code with which you can reproduce this problem and/or a MAT-file containing the cell array you passed into cell2mat?
Dae Woo Park
el 11 de Nov. de 2016
Editada: Walter Roberson
el 12 de Nov. de 2016
Walter Roberson
el 12 de Nov. de 2016
We need to know more about tool.handles.Panels and how it is constructed.
What do you find when you explore the difficulty with the debugger? What is the struct2cell(tool.handles.Panels) returning when you get the failure?
Dae Woo Park
el 11 de En. de 2017
Ahmed Ali
el 4 de Jul. de 2019
Good evening
I can not help you
Thank you very much

Undefined variable "xldata" or class "xldata.treat".
Error in main_disease_classification (line 21)
treat = uipanel.cell2mat(xldata.treat);
Respuesta aceptada
Más respuestas (2)
Abhinav Gurram
el 11 de Nov. de 2016
0 votos
It might very well be possible that the data you are trying to convert is not supported by the cell2mat function. cell2mat takes as input a cell array, in which all cells contain the same data type. The input cell array can contain numeric or character data within cells, or structures with the same field names and data types. However, cell2mat currently does not, nor has it ever accepted objects or nested cells within the input cell array. If your cell array contains objects or nested cells, this could be a possible reason for why you are seeing the error.
However, if your data is not in the form of objects or nested cells, it would be helpful if you can provide a sample of code that will help us reproduce this issue. I'm particularly interested to know why the code fails on R2012a and R2016a versions of MATLAB, but works fine on R2014a.
Cheers!
1 comentario
Walter Roberson
el 12 de En. de 2017
The code was creating a cell array each member of which is a uipanel object. cell2mat refuses to work with objects because objects cannot in general be concatenated. Potentially cell2mat could be enhanced to check ishghandle and allow the cell2mat in that case.
Dae Woo Park
el 12 de En. de 2017
Editada: Dae Woo Park
el 12 de En. de 2017
0 votos
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects 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!