MATLAB Answers

Chris H
0

If statement "if column 1 == column 2 then keep row"

Asked by Chris H
on 9 Oct 2019
Latest activity Answered by meghannmarie on 9 Oct 2019
Just wondering what the best way to execute this.
eg Column A, Column B & Column C
I want a subset of data to show for all columns and only show the rows where column A == column B. I've been searching for an easy example to follow with no luck.
I think I can get this done with an If statement but not too sure.

  0 Comments

Sign in to comment.

Products


Release

R2018b

1 Answer

Answer by meghannmarie on 9 Oct 2019

Have you tried something like this?
subData = data(colA == colB);

  0 Comments

Sign in to comment.