help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Convert a number to its binary representation (not string) as 1D Vec


From: Muthiah Annamalai
Subject: Re: Convert a number to its binary representation (not string) as 1D Vector
Date: Tue, 03 Oct 2006 11:48:24 -0500

Hello there,
It was more like the function dec2binvec() that  I was looking for.
http://www.mathworks.com/access/helpdesk/help/toolbox/daq/?/access/helpdesk/help/toolbox/daq/dec2binvec.html
Thanks for help everyone.

I actually found an implemnentation from the quantum Octave project 
http://quantum-octave.sourceforge.net/ at
http://quantum-octave.sourceforge.net/doc/Dec2BinVec.m.html

BTW quantum-octave is GPL'ed.

Regards,
Muthu

On Mon, 2006-10-02 at 14:39 +0200, Miquel Cabanas wrote: 
> dec2bin() does the conversion and returns a string. See "help dec2bin"
> for further details and related functions. Indeed, this function is
> coded as an m-file, try,
> 
> octave:9> type dec2bin
> 
> to see its content.
> 
> Miquel
> 
> On Mon, 2006-10-02 at 05:38 -0500, Muthiah Annamalai wrote:
> > Hello there,
> > I have a nice function Im writing, for which a hard part for me
> > is to convert a number to its binary representation as 1D Vector
> > of 1's & 0's. Now Im doing this using a while loop and appending
> > to the vector, which seems to throw speed into the trashcan; 
> > any and all suggestions welcome.
> > 
> > Thanks in advance,
> > -Muthu
> > 
> > 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]