フィルターのクリア

Scatter not showing full precision of data.

1 回表示 (過去 30 日間)
Andreas Hitzler
Andreas Hitzler 2023 年 10 月 18 日
移動済み: Walter Roberson 2023 年 10 月 18 日
I am trying to plot one measurement versus another withing the scatter function as such below but the result is that data is "sampled" at a much lower precision that the two column vectors I am supply it with. I have made sure to specify format long in my script. Any help would be beyond appreciated. I have attached the data below. It has ~16 digits of precision but I am not getting the double precision it says it is (as seen in the graph below).
figure;
hold on
scatter(ztemp,zrate,".")
ylabel('Angular Rate \omega_z [deg/s]');
xlabel('Rate Sensor Temperature Measurement [deg C]');
title('Angular Rate Measurements Vs. Temperature Sampled and Fitted');
ylim([-0.6 0.6])
xlim([-15 60])
hold off
saveas(gcf,'Angular Rate Measurements Vs. Temperature Sampled and Fitted.png')
  2 件のコメント
Walter Roberson
Walter Roberson 2023 年 10 月 18 日
if you calculate
duz = diff(unique(zdiff)) ;
min(duz)
what shows up?
Dyuman Joshi
Dyuman Joshi 2023 年 10 月 18 日
format only changes the way how the numerical values are displayed. It has no effect how numbers are stored and used for operations.
I don't understand what exactly your question is.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2023 年 10 月 18 日
移動済み: Walter Roberson 2023 年 10 月 18 日
format long g
whos -file data.mat
Name Size Bytes Class Attributes zrate 1180160x1 9441280 double ztemp 1180160x1 9441280 double
load('data.mat');
duz = diff(unique(zrate)) ;
min(duz)
ans =
0.0183199942111969
min(zrate), max(zrate)
ans =
-0.146559998393059
ans =
0.494639992713928
You may have 16 bits of precision, but your zrate is in bands that at least 0.018 apart.
G = findgroups(zrate);
max(G)
ans =
36
You only have 36 different zrate values.
scatter(ztemp,zrate,".")
If you were to increase your ylim enough then the difference of 0.0183 between layers would be insignificant compared to the span, and in that case it would look continuous... but it would not be.
figure();
scatter(ztemp,zrate,".")
ylim([-1 1])

その他の回答 (1 件)

Chunru
Chunru 2023 年 10 月 18 日
websave("data.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1514124/data.mat")
ans = '/users/mss.system.yOZ4c1/data.mat'
load("data.mat")
figure;
hold on
scatter(ztemp,zrate,".")
ylabel('Angular Rate \omega_z [deg/s]');
xlabel('Rate Sensor Temperature Measurement [deg C]');
title('Angular Rate Measurements Vs. Temperature Sampled and Fitted');
ylim([-0.6 0.6])
xlim([-15 60])
% whos
figure
% Your data (zrate) is in discrete groups
histogram(zrate)
figure
plot(sort(zrate))

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by