MATLAB Answers

How filter data by specified criterion

1 view (last 30 days)
Mekala balaji
Mekala balaji on 4 May 2018
Commented: Mekala balaji on 4 May 2018
Hi, I have cell array of data as show below:
1012 2018-1-25 22:01:15 VT0KETT00 Digital 22
1015 2018-1-29 22:14:34 HA0KETT00 Digital 128
1024 2018-1-25 22:01:15 VT0KETT00 Semi Digital 22
1044 2018-2-5 22:01:15 PT0KETT00 Interupt 34
1054 2018-2-13 22:1:15 BR0KETT00 Semi Digital 22
1067 2018-2-15 9:43:45 PT0KETT00 Interupt 34
I want to remove Interupt case, and keep only Digital & Semi Digital cases
1012 2018-1-25 22:01:15 VT0KETT00 Digital 22
1015 2018-1-29 22:14:34 HA0KETT00 Digital 128
1024 2018-1-25 22:01:15 VT0KETT00 Semi Digital 22
1054 2018-2-13 22:1:15 BR0KETT00 Semi Digital 22
Kindly some one help,

  0 Comments

Sign in to comment.

Accepted Answer

jonas
jonas on 4 May 2018
A is your 6x6 cell array, then:
[rows,~]=find(ismember(A, 'Interupt'))
A(rows,:)=[];
should do the trick

  3 Comments

Mekala balaji
Mekala balaji on 4 May 2018
Sir, This works, But, may be if there are other unwanted cases, Can I filter using "or"
For example "Digital" or Semi Auto"
1012 2018-1-25 22:01:15 VT0KETT00 Digital 22
1015 2018-1-29 22:14:34 HA0KETT00 Digital 128
1024 2018-1-25 22:01:15 VT0KETT00 Semi Digital 22
1044 2018-2-5 22:01:15 PT0KETT00 Interupt 34
1054 2018-2-13 22:1:15 BR0KETT00 Semi Digital 22
1067 2018-2-15 9:43:45 PT0KETT00 Interupt 34
1054 2018-2-13 22:1:15 BR0KETT00 Semi Auto 22
1067 2018-2-15 9:43:45 PT0KETT00 Abondoned 34
jonas
jonas on 4 May 2018
EDIT: seems this works
[rows,~]=find(ismember(A, 'Semi Auto') | ismember(A,'Digital'))
You can also repeat the filter several times with different strings

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by