How to store results of a Structure
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Patrick Campbell
le 21 Nov 2019
Commenté : Patrick Campbell
le 23 Nov 2019
Hi,
I am trying to save the output of a structure call.
info_h5 = hdf5info('hdf5_file.h5');
get_FileNames = info_h5.stuff.morestuff.FileNames
info_h5.stuff.morestuff.FilesNames returns 4 string outputs when I run it in command. However, the variable, get_FileNames, only equals the first of the 4 outputs. i.e. get_FileNames = '/file_1'.
How do i store all the outputs of this multilayered structure?
Thanks
0 commentaires
Réponse acceptée
Bhaskar R
le 21 Nov 2019
Convert to the cell array as
get_FileNames = {info_h5.stuff.morestuff.FileNames}; % enclosed in {} brackets
then access the data as
>> get_FileNames{1} % output 1
>> get_FileNames{2} % output 2
>> get_FileNames{3} % output 3
>> get_FileNames{4} % output 4
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!