How to creat a group of struct?
2 views (last 30 days)
Show older comments
"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 Comments
Answers (1)
per isakson
on 29 Oct 2016
Edited: per isakson
on 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 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!