Referencing a data set with non-integer values
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a data set of latitude/longitude values which have several decimals per point. What is the most efficient way to reference these without converting them to integers (I would lose data resolution)?
댓글 수: 0
답변 (1개)
Walter Roberson
2018년 5월 23일
Multiply by 10 to the power of the number of significant decimal places, and round or floor or ceil as appropriate, and use those integers.
But if it is efficiency you want, then you need to talk about efficiency for what purpose. For example for some purposes the highest efficiency is containers.Map which uses hashes to find data in constant time... once the hash is created.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Numeric Types에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!