Using indexing to find specific rows

조회 수: 1 (최근 30일)
Bryce Schuebert
Bryce Schuebert 2020년 2월 14일
댓글: Star Strider 2020년 2월 14일
I have a .CSV file that has the latitude, longitude, and elevation in three columns. I would like to bring that into my code, so if a certain longitude is typed in, then the latitude and elevation associated would be the out put. I am having problems with the import feature, and the numbers keep rounding up which is not good for what I am doing. Any help is greatly appreciated.

채택된 답변

Star Strider
Star Strider 2020년 2월 14일
There are a number of ways to read your file.
With respect to the rounding, that is only in the display. MATLAB maintains full internal precision.
With that in mind, however, the ismembertol funciton could be useful in retrieving the desired coordinates.
  댓글 수: 2
Bryce Schuebert
Bryce Schuebert 2020년 2월 14일
Awesome! I appreciate your response. I read how ismembertol works, but would it work with indexing? If I just copied and pasted my three columns into a vector array, would it still work?
Star Strider
Star Strider 2020년 2월 14일
Thank you!
Yes.
It returns a vector of logical elements. If you want specific numerical array indices, use find with it.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by