Use text strings in a cell array in a 'for loop' and also use that text string to name the output
2 views (last 30 days)
I have a list of 9 site names in a column array "sitearray". Those same 9 names appear in a data structure with subfolders, e.g. 9 matrices indexed by 'Data."sitename".matrix'. I would like to perform the same operation on each of the 9 matrices in a for loop e.g. extract the first value of the matrix, and save the output retaining each sitename. I cannot figure out how to link the text of the sitename to the counter variable in the code.
%(Below doesn't work)
Output_sitearray(i) = Data.sitename(i).matrix(:,);