MATLAB Answers


How can I see just a couple of datapoint based on a specific criteria

Asked by Locks
on 24 Apr 2013

I have a dataset that consists of double where I would like to see those rows where the column 10 is equal to 1

I tried this:


which is working fine but gives me only the first column. I would like to see the whole row and therefore I tried this:


but that's not working. what am I doing wrong?



No products are associated with this question.

1 Answer

Answer by the cyclist
on 24 Apr 2013
Edited by the cyclist
on 24 Apr 2013
 Accepted answer

So close ...

   >> dataset(dataset(:,10)==1,:)


on 24 Apr 2013

I tired that also, but it didn't work, I got this error:

Error: Unexpected MATLAB operator.

It's fine, I found it, a bracket was missing

the cyclist
on 24 Apr 2013

Sorry. I corrected that typo about 10 seconds after I posted, but you were too fast! Try the edited version.

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!