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: Miquel Cabanas
Subject: Re: Convert a number to its binary representation (not string) as 1D Vector
Date: Mon, 02 Oct 2006 14:39:53 +0200

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]