Hi,
I have a large database of 300+ subjects who belong to a number of groups.
I'd like to assign each subject to a group based on a table using a script.
Can I do that? Here's where I am at:
Protocol = bst_get('ProtocolInfo');
s = bst_get('ProtocolSubjects');
gps = readtable('Groups.csv');
for i = 1:size(gps,1)
isub = strcmp({s.Subject.Name},gps.Subject{i});
s.Subject(isub).Comments = gps.Group{i};
end
- Does it make sense to use the Comments field of the Subject structure to assign groups?
- If so, can I assign it back to the database?
- If not, is there a better way?
Many thanks,
Max