how to delete outliers data for 15 person Separately?

3 views (last 30 days)
Hello ,Have a good time.
I have 15 patients with 13 characteristic columns. After using the rmoutliers command(for delete outliers data), it overlaps all the rows of different people and shows it as 36221 * 13. And I want to know, for example, how many rows belong to the first patient and how many rows belong to the second patient is and... . (Must be in the form of 15 separate people * 13 columns to match it with the labels of these people.)
I put the MATLAB code related to my work here. I do not know what changes I should make to the codeand How can I determine which sections of data of sick people it corrects?.If anyone could help me, thank you.
DATA1=[];B1=[];
for i = 1:15
data1 = load(strcat(strcat('park',num2str(i)),'.ts'));
DATA1 = [DATA1;data1];
[B,TF]=rmoutliers(DATA1);B1=[B1:B];
end
Or, for example, if I use the find command, if I put DATA, it will override all the rows of different people, and if I use data, it will only display information about the 15th person.I put the MATLAB code related to my work here
temp1 = DATA1(:,2);temp1(find(temp1>1.6)) = [];
Thanks a lot.
  1 Comment
Jeff Miller
Jeff Miller on 24 Jun 2022
I can't see what you are trying to do. In particular, it makes no sense to me to call rmoutliers once with the data of patient 1, then again with the data of patients 1 & 2, then again with 1,2, and 3, ... It would make more sense to use either this (if you want rmoutliers to look at the data from all patients together)
DATA1=[];B1=[];
for i = 1:15
data1 = load(strcat(strcat('park',num2str(i)),'.ts'));
DATA1 = [DATA1;data1];
end
[B,TF]=rmoutliers(DATA1);
or else this (if you want rmoutliers to look at the data from each patient separately)
DATA1=[];B1=[];
for i = 1:15
data1 = load(strcat(strcat('park',num2str(i)),'.ts'));
[B,TF]=rmoutliers(data1);
DATA1 = [DATA1;B];
end

Sign in to comment.

Accepted Answer

Jeff Miller
Jeff Miller on 24 Jun 2022
I think I see the issue now. Maybe this is better:
DATA1=[];
SUBJECT = [];
for i = 1:15
data1 = load(strcat(strcat('park',num2str(i)),'.ts'));
[B,TF]=rmoutliers(data1);
subject = i*ones(size(B,1),1);
DATA1 = [DATA1;B];
SUBJECT = [SUBJECT; subject];
end
At the end of this loop, SUBJECT(i) will have the subject number for row i.

More Answers (2)

NGR MNFD
NGR MNFD on 24 Jun 2022
hello dear , thanks for your answer ,but both of this code matlab that you recommended me is the same. it get me a big vector for example 3251*13 or ...I mean that when I use rmoutliers command ,finally I like to know forexample from column 1 to 126 for the first subject and from column 127 to 320 for the second subject and....but with your matlab code all of my data sit in the one big matrix. and i do not know what number of row decrease from the first subject or the others. thanks alot again.

NGR MNFD
NGR MNFD on 28 Jun 2022
Edited: NGR MNFD on 28 Jun 2022
thanks so much dear jeff miller

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!