how to split a dataset based on values from one column
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
James Oxborrow
el 31 de Ag. de 2018
Editada: madhan ravi
el 31 de Ag. de 2018
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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/194880/image.png)
0 comentarios
Respuesta aceptada
madhan ravi
el 31 de Ag. de 2018
Editada: madhan ravi
el 31 de Ag. de 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 comentarios
madhan ravi
el 31 de Ag. de 2018
Editada: madhan ravi
el 31 de Ag. de 2018
Upload the data file to test.
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Import from MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!