Hi,
I have 6 table data with each of size 2000×100 with a random 1 & 0. I would like to sum all these 6 table data using a for loop and if the sum is less than 100 then i skip the particular case. If the sum is equal to 100 then i write that specific case to a new variable.
Now the issue is the Variable to combine and sum these 6 table data does not start at first row during each iteration. Instead they get shifted down by 1 row everytime.
I have pasted a sample code below, someone please help me fix it.
Sample Code: (I am just displaying 2 table variables)
K = 20for i = 1:1:K x1(i,:) = a1{i,:}; x2(i,:) = a2{i,:}; Threshold = [x1; x2]; Sum = sum(Threshold,2)'; clear Threshold if Sum == 26 y1(i,:) = x1{i,:}; y2(i,:) = x2{i,:}; clear Sum else i = i +1; clear Sum endclear x1 x2end
Best Answer