Borrar filtros
Borrar filtros

how to concatanate structures of different sizes?

4 visualizaciones (últimos 30 días)
Kavitha Srinivasan
Kavitha Srinivasan el 12 de Mzo. de 2014
Editada: Jacob Halbrooks el 12 de Mzo. de 2014
Hi all, could you please help me to solve this problem.
I have structures of different sizes and I want to concatenate them. 'catstruct' can merge only structures of same size. Is there anyway to concatenate these files. Actually I have dicom files whose metadata has to be read sequentially. the code could read about one-quarter of files and then stopped complaining " Subscripted assignment between dissimilar structures ". So I tried getting metadata in groups and then to concatenate. is this a good idea? Please suggest me how to solve this problem. Thanks

Respuestas (1)

Jacob Halbrooks
Jacob Halbrooks el 12 de Mzo. de 2014
Editada: Jacob Halbrooks el 12 de Mzo. de 2014
From the doc for concatenating structures:
To concatenate structures, they must have the same set of fields, but the fields do not need to contain the same sizes or types of data.
So if you truly wanted to concatenate your structs, you would have to add fields to the mismatched structs. This might make the data ambiguous, so I'd suggest you consider a different data structure. Cell arrays might be a good choice. Another option for heterogeneous data is to use tables .

Categorías

Más información sobre Structures 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!

Translated by