MATLAB: Filter series based on test but how to know what series passed?

filtering based on test

Hi all, i had some help with this already from Image but one thing is I need to know what variables passed the test, as there will be another one to run afterwards of which all remaining series need to be identified. Here's what I have so far. I would like to know how I can keep track of which variables passed this test (in this case it's x2 & x3); would appreciate any suggestions. Cheers
x1=5; x2=30; x3=40; x4=3; x=[x1,x2,x3,x4] xTL=sum(x,2)
x=[];
pct=.10;
test1 = pct * xTL
%aggregate test if x1 > test1 fprintf('Adding on x1:\n'); x = [x, x1]; end
if x2 > test1 fprintf('Adding on x2:\n'); x = [x, x2]; end
if x3 > test1 fprintf('Adding on x3:\n'); x = [x, x3]; end
if x4 > test1 fprintf('Adding on x4:\n'); x = [x, x4]; end

Best Answer

whichofthem = find([x2, x2, x3, x4] > test1)