how to delete outliers data for 15 person Separately?

조회 수: 3 (최근 30일)
NGR MNFD
NGR MNFD 2022년 6월 23일
편집: NGR MNFD 2022년 6월 28일
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
Jeff Miller
Jeff Miller 2022년 6월 24일
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

댓글을 달려면 로그인하십시오.

채택된 답변

Jeff Miller
Jeff Miller 2022년 6월 24일
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.

추가 답변 (2개)

NGR MNFD
NGR MNFD 2022년 6월 24일
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 2022년 6월 28일
편집: NGR MNFD 2022년 6월 28일
thanks so much dear jeff miller

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by