Referencing a data set with non-integer values

1 回表示 (過去 30 日間)
William Hanson
William Hanson 2018 年 5 月 23 日
回答済み: Walter Roberson 2018 年 5 月 23 日
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)?

回答 (1 件)

Walter Roberson
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.

カテゴリ

Help Center および File ExchangeNumeric Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by