How to use mat2cell in splitapply?
Mostrar comentarios más antiguos
Hi,
I used findgroup and get a G as the output. I would like to apply G to a numeric matrix (MxN) to split the matrix into several cells such that, each cell contains a smaller sized matrix (mxN).
How to write the code? I tried this but got error: Not enough input arguments. out = splitapply(mat2cell, mat, [1, 1], G); Thanks.
1 comentario
Jan
el 4 de Abr. de 2017
You use "mat2cell", which is a function call. Do you mean "@mat2cell", which is the function handle?
Respuesta aceptada
Más respuestas (1)
Sangeetha Jayaprakash
el 4 de Abr. de 2017
Editada: Sangeetha Jayaprakash
el 4 de Abr. de 2017
0 votos
I am assuming you are using the "findgroups" and "splitapply" functions to group a matrix into cells. From the error, it looks like the function "mat2cell" being applied to each group is not getting the required matrix argument.
Maybe the second format specified here to use splitapply might help:
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!