How to extract common & uncommon variables
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I have 5 test data of 10 (actually more than 150 variables) variables. Each test data of a particular variable is observed for one minute (50 data per minute), and I calculated the Standard deviation of 50 data point per each variable in each test. The STD is given below:
Test1 Test2 Test3 Test4 Test5
V1 0.00010 0.00200 0.01000 0.00300 0.00005
V2 0.00010 0.00000 0.01000 0.00300 0.00005
V3 0.00010 0.00200 0.02000 0.00100 0.00000
V4 0.00050 0.00100 0.03000 0.00100 0.00002
V5 0.00030 0.00200 0.01000 0.00200 0.00005
V6 0.00010 0.00300 0.00400 0.00310 0.00105
V7 0.00010 0.00100 0.01000 0.00310 0.00041
V8 0.00510 0.00500 0.00500 0.00140 0.00005
V9 0.00300 0.00200 0.03300 0.01300 0.03005
V10 0.00010 0.00200 0.01000 0.00300 0.00005
I want to extract the common variables in five tests whose STD >=0.001, and uncommon variables whose STD is <=0.001
Kindly someone help, and many thanks in advance,
1 commentaire
Réponses (1)
Walter Roberson
le 1 Fév 2018
Tests = [Test1,Test2,Test3,Test4,Test5];
common_vars = find(all(Tests>0.001, 2));
uncommon_vars = find(all(Tests<0.001, 2));
other_vars = setdiff(1:10, union(common_vars, uncommon_vars));
2 commentaires
Walter Roberson
le 1 Fév 2018
No -- V6 starts with 0.00010 which is 1/10th of 0.001
V8 ends in 0.00005 which is 1/20th of 0.001
In my code if you change the > to >= then you will get V9 as common.
Voir également
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!