Numerical problem in MATLAB (data precision)

1 view (last 30 days)
I have sevsral pairs of coordinate as follow in MATLAB Workspace:
22.7397142000000 113.488351100000
22.7669794000000 113.509290500000
22.7704230000000 113.507311200000
22.7669970000000 113.508321300000
22.7670235000000 113.508306300000
22.7696037000000 113.511283800000
22.7711551000000 113.508804100000
22.7711704000000 113.508833800000
22.7694847000000 113.512802400000
22.7693585000000 113.513163800000
22.7679902000000 113.518024500000
22.7691143000000 113.520290400000
22.7690086000000 113.520259300000
22.7689764000000 113.520256300000
22.7690396000000 113.520267700000
22.7692776000000 113.518461600000
22.7692416000000 113.518455000000
22.7684318000000 113.518207300000
22.7703652000000 113.514779800000
22.7708152000000 113.511255300000
22.7703001000000 113.515150400000
22.7712174000000 113.516411500000
22.7692346000000 113.516134300000
22.7715692000000 113.511309900000
22.7727208000000 113.510230300000
22.7727138000000 113.510273300000
22.7733021000000 113.508423100000
22.7729565000000 113.508392900000
22.7681272000000 113.515703800000
22.7715343000000 113.512768200000
22.7746171000000 113.508364000000
We can see that the precision is good.
However, when I try to plot them, the interface seems to only take the first four number after decimal point which makes
22.7690086000000 113.520259300000
22.7689764000000 113.520256300000
22.7690396000000 113.520267700000
exactly the same!
How to solve this problem? THANK YOU~
xy = [
% 22.7397 113.4884
22.7670 113.5093
22.7704 113.5073
22.7670 113.5083
22.7670 113.5083
22.7696 113.5113
22.7712 113.5088
22.7712 113.5088
22.7695 113.5128
22.7694 113.5132
22.7680 113.5180
22.7691 113.5203
22.7690 113.5203
22.7690 113.5203
22.7690 113.5203
22.7693 113.5185
22.7692 113.5185
22.7684 113.5182
22.7704 113.5148
22.7708 113.5113
22.7703 113.5152
22.7712 113.5164
22.7692 113.5161
22.7716 113.5113
22.7727 113.5102
22.7727 113.5103
22.7733 113.5084
22.7730 113.5084
22.7681 113.5157
22.7715 113.5128
22.7746 113.5084
]; % actually yx
[xx,yy] = meshgrid(xy(:,2),xy(:,1))
plot(xy(:,2),xy(:,1),'ok','MarkerFaceColor','k')
hold on
xline(xx(1,:))
yline(yy(:,1))

Accepted Answer

KSSV
KSSV on 20 Jun 2022
Read about format
format long
But this is not an issue, don't worry.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!