MATLAB Answers

How can I read an excel file without approximating values to 4 decimal places?

7 views (last 30 days)
I read an excel file as part of my code but the particular values I am interested are approximated to 4 decimal places instead of the higher places I would want to have. These are latitude and longitude values and every digit is important. Is there a way I can read all decimal places with any approximation?
This is in R2018b.

  0 Comments

Sign in to comment.

Accepted Answer

Stephen Cobeldick
Stephen Cobeldick on 9 Nov 2018
Edited: Stephen Cobeldick on 9 Nov 2018
MATLAB does not "approximating values to 4 decimal places" when reading file data, that is simply how the values are being displayed. Do not confuse how values are displayed with what values are actually stored in MATLAB memory: these are two quite different things! You can change how values are displayed by using the format function, e.g. run this in the command window:
format longg
then display your data again. Try other format options and pick one that you like.
If you are using the Variable Viewer then change its format options.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!