Why I can't display all the decimal digits in a plot?
Show older comments
My code converts a 2-columns string array (first image) into a 2-columns double array. After the conversion, the numbers in the matrix are cut off after the 4th decimal digits (second image) (I need 6 decimal digits) and if I plot the data, only the time axis values are cut off, this time after the 2nd decimal digit! (third figure) while the y axis data have all the 6 decimal digits required. How is it possible ?
<<



>>
Accepted Answer
More Answers (2)
Ata ur rahman Mohammed
on 28 Oct 2019
2 votes
The better solution is just update the number of decimal points in "text function". In data cursor mode, right click and select "edit text update function", in the variable output_txt= 'X: '. num2str(pos(1),4)]; update the 4 to 6 or 10, this defines total number of digits on the X axis data display. Hope this helps. Found from ALEX WINTEER's Commenthttps://groups.google.com/forum/#!searchin/comp.soft-sys.matlab/subject$3A%22Data$20cursor$20precision%22/comp.soft-sys.matlab/xEJlCB_e-X8/gMDlZZC7vb0J
3 Comments
Hernan Larriva
on 6 Dec 2019
It wasw useful for me, thanks!
Badrul Huda Husain
on 19 Aug 2020
Edited: Badrul Huda Husain
on 19 Aug 2020
Hi.. I'm quiet new in Matlab..would you guys tell me which command do I have to edit to make coordinate position digits more precise ? I try to following your discussion to edit "text function"in matlab R2020a

..I am attaching photo from my Matlab command
CARLOS SILVA
on 9 Sep 2020
It was very helpful for me!
Thank you very much!
Walter Roberson
on 10 Aug 2017
1 vote
2 Comments
stefano luna
on 16 Aug 2017
Edited: stefano luna
on 16 Aug 2017
Walter Roberson
on 16 Aug 2017
This is not the same as "format long". "format long" only affects displaying values to the command window. The Preferences affects the format of the Variable Browser.
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!