Avoid an Overflow problem

2 ビュー (過去 30 日間)
farouq
farouq 2013 年 5 月 14 日
Hello. I am building an accumulator which keeps adding the input. I want my resolution to be 2^-5. the maximum of my number is 73656000 which is bigger then the maximum allowed for a 32 bit. I got the following problem
Inconsistent numeric values for port 1 in 'MY16_CNs_DIDs/Subsystem/Sum': Maximum (736560000) is out of data type range [0, 1.34218e+008]
I need this to be 32bits and therefore I can't go to 64bits. any ideas how can I deal with this.
Thanks

回答 (1 件)

Matt J
Matt J 2013 年 5 月 14 日
It looks like it should be possible to represent the data as scaled uint32
>> log2(73656000*2^5)
ans =
31.1343

カテゴリ

Help Center および File ExchangeData Logging についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by