Why can i not add these arrays to a matrix
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
christiaan van Weeghel
el 22 de Feb. de 2018
Comentada: christiaan van Weeghel
el 22 de Feb. de 2018
Hello,
i've been trying to get some data matrixes together. They contain info on certain genes. The problem is that when i try to add the required P-values Matlab gives me a horzcat eror.
I've been adding them as such: [ILM, SDG, ID, P] with ILM, SDG and ID being general information from the dataset, they work fine. But when i try to add P it stops working. The array sizes of ILM, SDG and ID are all "750x1 cell" while the P is "750x1 double". is there a way to covert one to the other?
0 comentarios
Respuesta aceptada
Stephen23
el 22 de Feb. de 2018
Editada: Stephen23
el 22 de Feb. de 2018
You could convert the numeric array P into a cell array:
[ILM,SDG,ID,num2cell(P)]
But keep in mind that storing numeric data in a cell array makes accesing and processing that data more complex. If each of the other cell arrays contains only a scalar value in each cell then it might be better to convert them to one numeric array.
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!