Say I have a list of directories:
/users/david/patients/patientID/Day
/users/david/patients/patientID/Daya/HospID_x/Data
/users/david/patients/patientID/Dayb/HospID_y/Data
/users/david/patients/patientID/Dayc/HospID_z/Data
/users/david/patients/patientID/Day
/users/david/patients/patientID/Daya/HospID_x/Data
/users/david/patients/patientID/Dayb/HospID_y/Data
/users/david/patients/patientID/Dayc/HospID_z/Data
/users/david/patients/patientID/Day
.
.
The data is mixed, contains images, vectors, text and so on. I have generated a list of folders which contains data which I want to perform operations on. After working on these data types in the my script, I have generated a bunch of variables in the workspace. The variables are overwritten in the next cycle. I want to create a struct file which contains these variables or results. This means, a patient will have several DaysID under a patient ID and varying HospID under DaysID.
Patientand go deeper each loop. The name of the fields can be set in this fashion,t='DayA'; q.(t) = 'foo';. Try this. It is hard to provide code when I do not know exactly what your variables looks like. With nested struct array, I mean an array of structs containing other structs or struct arrays/users/david/patients/patientID/Dayare these empty folders wtih that exact name (maybe except for that the patient id which is unique)?