Renaming and exporting to excel struct array data

1 view (last 30 days)
Hi everybody!
I have a struct array data: besa_sourcemodel_all =
1x42 struct array with fields: structtype source datafile description condition
where source is: ans =
1x2 struct array with fields: locationUS orientationUS locationDEV orientationDEV locationHC orientationHC locationTAL orientationTAL label type
In besa_sourcemodel_all I have two 2 conditions per study subject and in each source 2 things where I can access locationTAL (that is actually what I am looking for), which has 3 numbers.
The sources are not properly named (I didn’t create the folder but it was exported like this from another program), so for example for the first subject, second conditions, first source is: besa_sourcemodel_all(1,2).source(1,1).locationTAL
What I would like to do is to have all locationTAL data (for all subjects and conditions) in one excel sheet.
I found out that I could make a single (properly named variable) each containing the locationTAL for one subject, one condition and then combine all the variables into one (use: combined=[A; B; C]) and then export that one to excel.
I wanted to ask if there is a better way to do it than just writing everything down by hand.
Thank you very much for your help :) Aleksandra

Answers (0)

Community Treasure Hunt

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

Start Hunting!