Be the first to rate this file! 9 Downloads (last 30 days) File Size: 1.26 KB File ID: #7264

Matrix-Number Conversion



24 Mar 2005 (Updated )

2 files. Matrix to number & number to matrix conversion.

| Watch this File

File Information

matrix2num([1,0,0]) yields 100,
  assumes base 10.
matrix2num([1,0,0],2) yields 4,
  using base 2.
  bases 2-10 only, otherwise NaN.
  Activates rounding safety.
  Because of the floating point
    rounding error numbers w/more
    than 16 digits will output as
    NaN with this feature on.
    Default is off.

num2matrix('1234') yields [1,2,3,4]
num2matrix('1234',2) yields [1,2;3,4]
  Enter # of cols if you wish to limit
  The characters will wrap to next row
The number is inputed as a string,
  so you can convert digits like 0010,
  It will yield [0,0,1,0]

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
01 Apr 2005

added feature

Contact us