Compare cells in cell array to find common columns
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
sr9497
el 30 de Mzo. de 2022
I have two cell arrays, data 1 (1x6 cell) and data 2 (1x8 cell) where each cell consists of 3x5 double or 3x4 double. I would like to compare these cell arrays and find out which cells have at least two columns in common, e.g. data1{1,1} and data2{1,1} have two columns in common. Then I would like to store all these cells in a new cell array.
What is the best way to do this?
0 comentarios
Respuesta aceptada
Matt J
el 30 de Mzo. de 2022
Editada: Matt J
el 30 de Mzo. de 2022
You should just use an explicit loop over all combinations of cells. With cell arrays, there is never a good reason to look for some kind of fancy vectorization, and certainly not with arrays as small as what you've posted.
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrices and Arrays 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!