フィルターのクリア

floating point to binary conversion

13 ビュー (過去 30 日間)
ashok
ashok 2014 年 4 月 28 日
回答済み: Walter Roberson 2014 年 4 月 28 日
if true
% code
if a =
-5932.62103114252
5931.17666698258
5797.34103035393
-6358.78042353988
-12430.1210180646
-9849.27324380255
-6386.88118380371
7783.15716000243
5177.38696737792
6082.47763148202
-4816.43707738488...........
end
how to convert this to binary? with out using uint8,16,64 i need the output in double
if i use uint the values are rounded off and i am not able to reconstruct (image) is there any possibilities to convert it.
because after converting it i need to modulate and transmit.

採用された回答

Walter Roberson
Walter Roberson 2014 年 4 月 28 日
dec2bin(typecast(YourFloatingPointVector, 'uint64'), 64) - '0'

その他の回答 (1 件)

Image Analyst
Image Analyst 2014 年 4 月 28 日
I don't know what you mean. The image already is in double. What do you mean by "binary"? You mean binary like a binary image, where the pixels are true or false and the data type is logical? You can create that by thresholding and casting to double:
binaryImage = a < 1000; % Whatever value... binaryImage is of type "logical".
doubleImage = double(binaryImage); % Make double.
What are you talking about uint8, uint16, etc. Those aren't binary except in the sense that ALL numbers in a computer are binary. Maybe you want the dec2bin() function to turns numbers into strings of 0's and 1's.

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by