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!