How to extract common & uncommon variables

1 visualización (últimos 30 días)
Mekala balaji
Mekala balaji el 27 de En. de 2018
Comentada: Walter Roberson el 1 de Feb. de 2018
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 comentario
Bernhard Suhm
Bernhard Suhm el 1 de Feb. de 2018
Can you clarify what you mean by "common" versus "uncommon" variables?

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 1 de Feb. de 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 comentarios
Mekala balaji
Mekala balaji el 1 de Feb. de 2018
Editada: Walter Roberson el 1 de Feb. de 2018
clear all;
clc
[a,b,c]=xlsread('D:\Data/coomonInput.xlsx');
Tests=cell2mat(c(2:end,2:end));
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));
do I need to concatenate the column like FinalTests=[Tesst(:,1),Tesst(:,2),Tesst(:,3),Tesst(:,3),Tesst(:,4),Tesst(:,5)]
It gives me the following result:
>> common_vars
common_vars =
9
>> uncommon_vars
uncommon_vars =
0×1 empty double column vector
>> other_vars
other_vars =
1 2 3 4 5 6 7 8 10
But my desired output:
Name of variable(s) whose value is <=0.001 in all "tests"-->Commom
For example: If I set:
common_vars = find(all(Tests>0.005, 2));
it should give me:
[V6 V8]
-->because its values are <=0.006 in all tests)
Walter Roberson
Walter Roberson el 1 de Feb. de 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.

Iniciar sesión para comentar.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by