Home > freetb4matlab > strings > base2dec.m

# base2dec

## PURPOSE

% Convert @var{s} from a string of digits of base @var{b} into an

## SYNOPSIS

function out = base2dec (d, base)

## DESCRIPTION

```% -*- texinfo -*-
% @deftypefn {Function File} {} base2dec (@var{s}, @var{b})
% Convert @var{s} from a string of digits of base @var{b} into an
% integer.
%
% @example
% @group
% base2dec ('11120', 3)
%      @result{} 123
% @end group
% @end example
%
% If @var{s} is a matrix, returns a column vector with one value per
% row of @var{s}.  If a row contains invalid symbols then the
% corresponding value will be NaN.  Rows are right-justified before
% converting so that trailing spaces are ignored.
%
% If @var{b} is a string, the characters of @var{b} are used as the
% symbols for the digits of @var{s}.  Space (' ') may not be used as a
% symbol.
%
% @example
% @group
% base2dec ('yyyzx', 'xyz')
%      @result{} 123
% @end group
% @end example
% @seealso{dec2base, dec2bin, bin2dec, hex2dec, dec2hex}
% @end deftypefn```

## CROSS-REFERENCE INFORMATION

This function calls:
• strjust % Shift the non-blank text of @var{s} to the left, right or center of
This function is called by:
• bin2dec % Return the decimal number corresponding to the binary number stored
• hex2dec % Return the integer corresponding to the hexadecimal number stored

Generated on Sat 16-May-2009 00:04:49 by m2html © 2003