Your loop does not seem to make any sense
Having a for loop such as
for j = 1:length(DATA(ii).GAIT_INFO);
means that j will take on values of 1, 2, 3.. up to what ever the termination condition is, in this case
length(DATA(ii).GAIT_INFO)
so j is just an integer. But then you have the statement
todelete = (j(:,1) == 1);
which makes no sense as why would you want to find out the locations where any row, column 1 of an integer equals one, which is what you are doing.
I think you also have some other problem with your termination condition itself.
length(DATA(ii).GAIT_INFO)
I think you probably want to do something like
for j = 3:size(filenames,1)
A = DATA(j).GAIT_INFO;
todelete = A(:,1) == 1 ;
A(todelete,:) = [];
todelete= A(:,6) == 1;
A(todelete,:) = [];
DATA(j).GAIT_INFO = A
end
The above code could be cleaned up further, but I think this should give the idea
Best Answer