How to creat a group of struct?

3 次查看(过去 30 天)
YZ
YZ 2016-10-29
编辑: per isakson 2016-10-29
"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.

回答(1 个)

per isakson
per isakson 2016-10-29
编辑:per isakson 2016-10-29
"What is the data type this array?" &nbsp Answer: struct array
" How to achieve this?" &nbsp 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 =
''

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by