I am trying to access data that are stored in structures in matlab. Having many files I am trying to make the process automatic, however I have a problem in accessing the struct using the structure name (given that it is a string). Also, storing the structure in a variable (as shown below) does not work either, because matlab attaches the whole structure to the variable. Does anybody have an idea on how to do this?
%Initialize variables
Data_Struct = load(dirData(1).name);
file_id = fieldnames(Data_Struct);
data = Data_Struct.Trajectories;
