cast64BitIntToFi
Syntax
Description
Examples
Cast an Integer to a fi
Object
Use the castIntToFi
and
cast64BitIntToFi
functions to cast integer data types in your code
to equivalent fi
objects.
Create a variable with a signed 16-bit integer data type. Cast the variable to an
equivalent fi
object using the castIntToFi
function.
u = int16(25); y1 = castIntToFi(u)
y1 = 25 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 0
The output fi
object has the same word length and signedness as
the input, and zero fraction length.
The cast64BitIntToFi
function casts only 64-bit integer data
types to an equivalent fi
object. All other input data types retain
their data type.
In this example, because the input is not an int64
or
uint64
data type, the output remains an
int16
.
y2 = cast64BitIntToFi(u)
y2 = int16 25
When you pass an int64
into the
cast64BitIntToFi
function, the output is a fi
object with a 64-bit word length and zero fraction length.
u = int64(25); y3 = castIntToFi(u)
y3 = 25 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 64 FractionLength: 0
Input Arguments
u
— Numeric input
scalar | vector | matrix | multidimensional array
Numeric input array, specified as a scalar, vector, matrix, or multidimensional array.
Data Types: double
| single
| half
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| fi
Complex Number Support: Yes
Output Arguments
y
— Numeric output
scalar | vector | matrix | multidimensional array
Numeric output, returned as a scalar, vector, matrix, or multidimensional array with the same value and dimensions as the input.
When the data type of u
is a 64-bit integer type, the output is
a fi
object with a 64-bit word length, fraction length of zero, and the
same signedness as the input. Otherwise, the output has the same data type as the
input.
Version History
Introduced in R2020a
See Also
cast64BitFiToInt
| castFiToInt
| castFiToMATLAB
| castIntToFi
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)