how to delete outliers data for 15 person Separately?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
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
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.
댓글 수: 0
추가 답변 (2개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!