필터 지우기
필터 지우기

how to split a dataset based on values from one column

조회 수: 1 (최근 30일)
James Oxborrow
James Oxborrow 2018년 8월 31일
편집: madhan ravi 2018년 8월 31일
I have this dataset and want to split it into two data sets based on wether the values in the 7th column (etd) are >25 or <25. how would i go about doing this?

채택된 답변

madhan ravi
madhan ravi 2018년 8월 31일
편집: madhan ravi 2018년 8월 31일
column7 = datasets(:,7)
for i = 1:numel(column7)
if column7(i) > 25
above25(i) = column7(i)
elseif column7(i) < 25
below25(i) = column7(i)
end
end
above25(above25==0)=[]
below25(below25==0)=[]
  댓글 수: 4
madhan ravi
madhan ravi 2018년 8월 31일
편집: madhan ravi 2018년 8월 31일
Upload the data file to test.
James Oxborrow
James Oxborrow 2018년 8월 31일
donn't worry, i figured it out. Thanks

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by