Home Questions trial ordering in c3d_load

trial ordering in c3d_load

DWQA QuestionsCategory: KINARM Datatrial ordering in c3d_load
Duncan McLean Staff asked 9 years ago
From brunfeld I am reading in data using zip_load found in the c3d_load folder downloaded from you website. I noticed that the output is a struct array that is ordered via TP number, not trial number. Is there a way to have the output to zip_load order in terms of trial number?
1 Answers
Duncan McLean Staff answered 9 years ago
Hi Alex, The trials should be load in the order they were run, this is the TRIAL:TRIAL_NUM parameter. You could sort by just the TP and there are a number of ways to do this. The quick and dirty way I just found is a script like: exam_data = zip_load; for idx=1:size(exam_data.c3d, 2) exam_data.c3d(1, idx).TP = exam_data.c3d(1,idx).TRAIL.TP; end nestedSortStruct(exam_data.c3d, 'TP'); The nestedSortStruct came from this MATLAB article: http://blogs.mathworks.com/pick/2010/09/17/sorting-structure-arrays-base... Please let me know if that helps.