필터 지우기
필터 지우기

Filter Only Data Meeting Certain Criteria out of Excel Spreadsheet

조회 수: 2 (최근 30일)
Emily McLain
Emily McLain 2023년 6월 21일
답변: Star Strider 2023년 6월 21일
I'm trying to plot some data imported from Excel in MatLAB. The data is angle and latitude over the period of a year, so there is quite a lot of data (around 525,600 lines). However, I only care about data that's in the latitude range of 60 to 85 degrees. Is there a way in MatLAB to filter out only the 60-85 degree angle data?

답변 (1개)

Star Strider
Star Strider 2023년 6월 21일
Use ‘logical indexing’ to return the desired values —
Lat = 90*rand(10,1);
Angle = pi*rand(size(Lat));
Data = table(Lat,Angle)
Data = 10×2 table
Lat Angle ______ _______ 12.051 2.1149 1.5097 3.0887 35.889 1.1831 55.397 0.84207 79.59 0.38152 25.187 1.26 20.226 2.3513 20.83 1.4799 7.9479 1.6882 74.649 2.2967
Lv = 60 <= Data.Lat & Data.Lat <= 85 % Logical Vector
Lv = 10×1 logical array
0 0 0 0 1 0 0 0 0 1
DesiredResult = Data(Lv,:)
DesiredResult = 2×2 table
Lat Angle ______ _______ 79.59 0.38152 74.649 2.2967
Make appropriate changes to work with your data.
.

카테고리

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

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by