필터 지우기
필터 지우기

I have a time table with 10 columns and I want to apply same filter to multiple columns.

조회 수: 2 (최근 30일)
I want to select only those rows where "data in column 2,3,4,5 > 15 and <20" and "data in column 6,7,8,9 > 2000 and <2500" Any Idea on how to approach this problem? Please help!

채택된 답변

Stephan
Stephan 2018년 8월 6일
편집: Stephan 2018년 8월 6일
Hi,
this is nearly the same question as you had some weeks before:
however, here is an example which selects only rows which meet conditions for 2 rows. You can extend this - use the attached .mat-file which contains date-time vector and temperature-values.
load('date_time_data.mat');
A = table(date, high, low);
>> whos A
Name Size Bytes Class Attributes
A 55237x3 1327014 table
Now make a new table only containing negative values for the column "low":
B = A(A.low<0,:);
>> whos B
Name Size Bytes Class Attributes
B 5014x3 121662 table
now make a new table, where all values (high and low) are <0:
C = A(A.low<0 & A.high <0,:);
>> whos C
Name Size Bytes Class Attributes
C 370x3 10206 table
Best regards
Stephan

추가 답변 (0개)

카테고리

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

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by