フィルターのクリア

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 件のコメント
James Oxborrow
James Oxborrow 2018 年 9 月 1 日
haha, same person. I thought i'd fixed it but it still isn't working.
madhan ravi
madhan ravi 2018 年 9 月 1 日
Anyways hope you found the answer so good.

サインインしてコメントする。

採用された回答

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?
James Oxborrow
James Oxborrow 2018 年 9 月 1 日
I've converted it to a matrix and that works great. Thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by