bytes of double may be aren't sufficient!
4 views (last 30 days)
Show older comments
200201382 is getting converted to 200200000 as it is received by matlab as 2.002e+08. I need it to be as 200201382 itself an need matlab to input it as 200201382. How can I do this? Thank you in advance.
1 Comment
Answers (2)
John D'Errico
on 6 Apr 2015
Edited: John D'Errico
on 6 Apr 2015
I think you need to learn about the format command. That it is DISPLAYED on the command line as such is not relevant.
The range of a double is entirely adequate for that number. It is stored properly. You simply don't know that it is.
help format
format long g
A common problem is when you have many numbers of different magnitudes in a vector or array. Then MATLAB will choose to use a scientific notation for the display, with limited number of digits displayed.
v = [.0001;200201382]
v =
1.0000e-04
2.0020e+08
As you can see, it LOOKS like the second element of v was not stored properly. However, MATLAB knows what it is.
v(2)
ans =
200201382
0 Comments
Srikar Chinam
on 6 Apr 2015
4 Comments
Image Analyst
on 6 Apr 2015
Please attach the data file - just the first few lines, not the whole thing.
John D'Errico
on 6 Apr 2015
Edited: John D'Errico
on 6 Apr 2015
How are you reading it in? While you SAY that you will be specific, so far, we have seen only hints of what you are doing. Making us guess?
See Also
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!