Learn R Programming

adana (version 1.1.0)

decode: Convert from binary number to real number

Description

The function decode converts a binary number with m digits to a real number between the lower and upper bound.

Usage

decode(bin, lb, ub, m)

Arguments

bin

A binary number

lb

Lower bound of real number

ub

Upper bound of real number

m

Number of the digits of output value.

Value

Returns the real equivalent of the input number.

Details

This function converts a binary number with m digits to its real equivalent expressed in the range [lb, ub].

See Also

encode

Examples

Run this code
# NOT RUN {
x = c(0,1,0,0,0,0,1,1)
decode(x, lb=50, ub=250, m=8)
# }

Run the code above in your browser using DataLab