Edit:Value Exceeeds while dividing
1 回表示 (過去 30 日間)
古いコメントを表示
I have 16 bit values and 14 bit values of same size
A=16 bit values ,B=14 bit values
i have sorted suxh a way that maximum value of 14 bit comes under max valu of 16 bit and so on,finally minimum of 14 bit comes min of 16 bit
used command as
[~,idx]=sort(A)
[~,idx1]=sort(idx)
C=B(idx1);
Dw=C./Cw
Dw=Dw*100;
the value of Dw exceeds 5 bit ,plese tell why i get this
suppose if max of 14 bit 8192/max of 16 bit 32767 we get 25 ,which is a 5 bit ,then why get more than 5 bit,please help
8 件のコメント
Walter Roberson
2012 年 11 月 29 日
sort() and unique() work on negative values as well. Is the concern about the possibility that the max(16bit) might be negative and of small absolute value, but max(14bit) might be positive, leading to a large number divided by a number that is small absolute value?
Can you reproduce the large-result problem with a small demonstration vector that you could post?
採用された回答
その他の回答 (1 件)
Walter Roberson
2012 年 11 月 29 日
Remember, negative divided by negative gives positive, so if -12 as a 14 bit number happened to get paired with -1 as a 16 bit number, the ratio would be -12/-1 which would be 12.
But you don't even need to take into account negatives for this. If 12 as a 14 bit number happened to get paired with 1 as a 16 bit number, the ratio would be 12 anyhow. Consider for example
14 bit: [12 30]
16 bit: [1 100]
then 12/1 = 12, 30/100 = 1/3, so the ratio of their maximums (30, 100) would be much smaller the internal ratio.
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!