Given a table, how can I delete rows not satisfying a certain property?

조회 수: 1 (최근 30일)
Given a table, i want to build a new table keeping only rows where values of column 1 are 35<x<40 and values of column 2 are 20<y<22, other values doesn't interest me. Alternatively i want column vectors without not desiderate values

채택된 답변

Bhaskar R
Bhaskar R 2020년 1월 24일
Assuming t is your table variable and variable names are col_1 and col_2,
cond = (35>t.col_1 & t.col_1<40)&(20>t.col_2 & t.col_2<20); % your condition
new_t = t(cond, :) ; % your new table based on condition

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by