Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

bitreplicate

Replicate and concatenate bits of fi object

Syntax

c = bitreplicate(a,n)

Description

c = bitreplicate(a,n) concatenates the bits in fi object a n times and returns an unsigned fixed-point value. The word length of the output fi object c is equal to n times the word length of a and the fraction length of c is zero. The bit representation of the stored integer is in two's complement representation.

The input fi object can be signed or unsigned. bitreplicate concatenates signed and unsigned bits the same way.

bitreplicate only supports fi objects with fixed-point data types.

bitreplicate does not support inputs with complex data types.

Sign and scaling of the input fi object does not affect the result type and value.

Examples

The following example uses bitreplicate to replicate and concatenate the bits of fi object a.

a = fi(14,0,6,0);
a_binary = a.bin
c = bitreplicate(a,2);
c_binary = c.bin

MATLAB® returns the following:

a_binary =

001110


c_binary =

001110001110

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2008a

Was this topic helpful?