How to creat a group of struct?

3 Ansichten (letzte 30 Tage)
YZ
YZ am 29 Okt. 2016
Bearbeitet: per isakson am 29 Okt. 2016
"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.

Antworten (1)

per isakson
per isakson am 29 Okt. 2016
Bearbeitet: per isakson am 29 Okt. 2016
"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 =
''

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by