[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: |
Mon, 02 Oct 2006 11:31:46 -0500 |
Hello there,
I actually wanted to say, that I wanted a bit-vector representation of
the integer. Sorry for trouble.
-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
> >
> >
>