Clear Filters
Clear Filters

how to split a dataset based on values from one column

5 views (last 30 days)
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?

Accepted Answer

madhan ravi
madhan ravi on 31 Aug 2018
Edited: madhan ravi on 31 Aug 2018
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 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!