filter series based on test but how do I know what series passed??
Ältere Kommentare anzeigen
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
1 Kommentar
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Spreadsheets finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!