필터 지우기
필터 지우기

I am trying to split the following data set into 2 based on whether the values in the 7th column (etd) are greater than or less than 25

조회 수: 1 (최근 30일)
I tried using this code but it returned multiple errors.
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)=[]
  댓글 수: 3

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

채택된 답변

KSSV
KSSV 2018년 9월 1일
Let data be you matrix of whole data.
iwant1 = data(data(:,7)<25,:) ;
iwant2 = data(data(:,7)>=25,:) ;
  댓글 수: 2
James Oxborrow
James Oxborrow 2018년 9월 1일
Now its giving me the error
"Undefined operator '<' for input arguments of type 'dataset'."
is this because my data is in a dataset not a matrix? if so how would i change it?

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by