How to creat a group of struct?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
"info_temp" is 1x1 struct with 426 fields. I want to create an array with 50 elements, and each element is 1x1 struct with 426 fields like "info_temp". What is the data type this array? How to achieve this? Actually "info_temp" is from DICOM header. I need to read the DICOM header from 50 images and group them together. Thank you.
0 commentaires
Réponses (1)
per isakson
le 29 Oct 2016
Modifié(e) : per isakson
le 29 Oct 2016
"What is the data type this array?"   Answer: struct array
" How to achieve this?"   something like this
info_temp = struct('f1',num2cell(1:50), 'dicom','');
whos info_temp
info_temp(23).dicom = 'd23';
info_temp(23).dicom
info_temp(48).dicom
which outputs
Name Size Bytes Class Attributes
info_temp 1x50 11728 struct
ans =
d23
ans =
''
0 commentaires
Voir également
Catégories
En savoir plus sur Read and Write Image Data from Files dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!