Indices shown in plot are off
古いコメントを表示
For large vectors, the indices shown in a figure are a bit off. For example:
test = [zeros(1,1079998), 1, zeros(1,1457106-1079998), 1, zeros(1,2159999-1457108)];
find(test) % gives correct indices: 1079999 1457108
figure; plot(test)
% The labeling of the 1's in the plot using data tips give idices of 1080000 and 1457110
This is probably a numeric precision issue.
回答 (1 件)
My guess is that the x-axis has a resolution of 10.
7 件のコメント
Davis
2024 年 5 月 20 日
Torsten
2024 年 5 月 20 日
Yes, because your new data vector has 1/10 of the elements of the first. Thus its resolution can be chosen as 1.
Try for a data vector with 10x the number of elements of the first. My guess is that the resolution achieved is 100.
Davis
2024 年 5 月 20 日
Torsten
2024 年 5 月 21 日
Then I don't know and you should report it as a potential bug to TMW:
Davis
2024 年 5 月 21 日
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!