How to extract common & uncommon variables
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Walter Roberson
2018-2-1
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 个评论
Walter Roberson
2018-2-1
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!