[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bin2dec behavior different from Matlab?
From: |
ahowe42 |
Subject: |
Re: bin2dec behavior different from Matlab? |
Date: |
Thu, 22 Mar 2012 01:31:41 -0700 (PDT) |
Miguel
Instead of having your students learn num2str, you could show them how
sprintf works. Since this comes from C, it's widely applicable and gives
more control. For the specific issue here, if x is a logical array, you can
do this:
xstr = sprintf("%d",x)
then bin2dec(xstr) is 5 as expected.
Andrew
--
View this message in context:
http://octave.1599824.n4.nabble.com/bin2dec-behavior-different-from-Matlab-tp4477272p4494856.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.
- Re: bin2dec behavior different from Matlab?, (continued)
- Re: bin2dec behavior different from Matlab?, Rik, 2012/03/16
- Re: bin2dec behavior different from Matlab?, Daniel J Sebald, 2012/03/16
- Re: bin2dec behavior different from Matlab?, Daniel J Sebald, 2012/03/17
- Re: bin2dec behavior different from Matlab?, Jordi GutiƩrrez Hermoso, 2012/03/17
- Re: bin2dec behavior different from Matlab?, Daniel J Sebald, 2012/03/17
- Re: bin2dec behavior different from Matlab?, Daniel J Sebald, 2012/03/17
- Re: bin2dec and cellfun improvements, Rik, 2012/03/18
- Re: bin2dec and cellfun improvements, Daniel J Sebald, 2012/03/18
- Re: bin2dec and cellfun improvements, Daniel J Sebald, 2012/03/20
- Re: bin2dec behavior different from Matlab?, Daniel J Sebald, 2012/03/16
Re: bin2dec behavior different from Matlab?,
ahowe42 <=