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

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.

답변 (1개)

meghannmarie
meghannmarie 2019년 10월 9일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

릴리스

R2018b

태그

질문:

2019년 10월 9일

답변:

2019년 10월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by