Info

This question is closed. Reopen it to edit or answer.

Constric dataset according to its items value

1 view (last 30 days)
Paul
Paul on 9 Sep 2013
Closed: MATLAB Answer Bot on 20 Aug 2021
Dear Mathworks!
I have a dataset which contains only numbers in two coloums, named x_inf and y_inf. I have used the sortrow function to sort the rows, and I want to constrict the dataset by deleting those rows, where 'a'<=x_inf<='b', where 'a' and 'b' are constants.
How can I solve this?

Answers (1)

Sean de Wolski
Sean de Wolski on 9 Sep 2013
x = randperm(100);
a = 30;
b = 70;
x2 = x(x>a&x<b)

Community Treasure Hunt

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

Start Hunting!