From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: decimal fraction to binary conversion
Date: Fri, 2 Dec 2011 14:51:08 +0000 (UTC)
Organization: Georgia Institute of Technology
Lines: 14
Message-ID: <jbaoks$guf$>
References: <jbab7h$47b$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1322837468 17359 (2 Dec 2011 14:51:08 GMT)
NNTP-Posting-Date: Fri, 2 Dec 2011 14:51:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1760883
Xref: comp.soft-sys.matlab:751219

"hend " <> wrote in message <jbab7h$47b$>...
> Hello everybody;
> i'm in need to a program code which can convert negative fractions into binary form ( any form )  ..
> dec2bin command is not helpful in this case !

There are several problems here. You will have to utilize a scheme such as Two's complement in order to represent both positive and negative numbers in binary form. 

You will need to add a sign bit before the binary number representing the number. So if you want to represent +5, 5 would typically be 101, but add a sign bit and it becomes 0101. Now to represent a negative number, your sign bit will be 1 and the following numbers will be the two's complement of 5 and you end up with 1011. 

You can read more here:'s_complement

Also, dec2bin doesn't handle fractions like you think, it returns the binary representation of only the integer portion of your input.