How to creat a group of struct?
1 回表示 (過去 30 日間)
古いコメントを表示
"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 件のコメント
回答 (1 件)
per isakson
2016 年 10 月 29 日
編集済み: per isakson
2016 年 10 月 29 日
"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 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!