How to get back real value after rounding
1 回表示 (過去 30 日間)
古いコメントを表示
Hello, I have the value 3.3 and 0.5, when I apply my algorithim i round the value to 3.3 to 3 and 0.5 to 1.
I want to get back the real value 3.3 and 0.5 after rounding. How can i do that in MATALAB.
0 件のコメント
採用された回答
Steven Lord
2022 年 12 月 16 日
Unless you've stored those un-rounded values in a variable that still exists, you can't.
Suppose I tell you I bought two items A and B from the store, and that their prices (rounded to the nearest dollar) are each $3. Is item A or item B more expensive? With just the information I gave you that question is impossible to answer. You'd need something else, like a peek at my receipt (which would have the original prices, and in this case would correspond to having a backup copy of the original data in a separate variable) to answer that question.
0 件のコメント
その他の回答 (1 件)
Arif Hoq
2022 年 12 月 16 日
a=[3.3 0.5];
round_vector=round(a)
c=a-round_vector;
origin_vector=round_vector+c
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!