时代
Element-by-element multiplication offi
objects
Syntax
C =A.*B
C = times(A, B)
Description
Examples
Multiply a fi Object by a Scalar
Use the时代
function to perform element-by-element multiplication of afi
object and a scalar.
= 4;b = fi ([2 4 7; 9 0 2])
b = 2 4 7 9 0 2 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 11
a
is a scalar double, andb
is a matrix offi
objects. When doing arithmetic between afi
两倍,两倍被铸成fi
with the same word length and signedness of thefi
和最佳精确分数长度。操作的结果是fi
.
c=a.*b
c = 8 16 28 36 0 8 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 32 FractionLength: 23
During the operation,a
was cast to afi
object with wordlength 16. The output,c
, is afi
object with word length 32, the sum of the word lengths of the two multiplicands,a
和b
. This is because the default setting ofProductMode
infimath
isFullPrecision
.
乘以两个FI对象
Use the时代
function to perform element-by-element multiplication of twofi
objects.
a=fi([5 9 9; 1 2 -3], 1, 16, 3)
a = 5 9 9 1 2 -3 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 3
b = fi ([2 4 7; 9 0 2], 1, 16, 3)
b = 2 4 7 9 0 2 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 3
c=a.*b
c = 10 36 63 9 0 -6 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 32 FractionLength: 6
单词长度和分数的长度c
are equal to the sums of the word lengths and fraction lengths ofa
和b
. This is because the default setting ofProductMode
infimath
isFullPrecision
.
Input Arguments
A
—Input array
scalar|vector|matrix|multidimensional array
Input array, specified as a scalar, vector, matrix, or multidimensional array offi
objects or built-in types.A
和B
除非一个标量值,否则必须具有相同的维度。
Data Types:fi
|single
|double
|int8
|int16
|int32
|int64
|uint8
|uint16
|uint32
|uint64
Complex Number Support: Yes
B
—Input array
scalar|vector|matrix|multidimensional array
Input array, specified as a scalar, vector, matrix, or multidimensional array offi
objects or built-in types.A
和B
除非一个标量值,否则必须具有相同的维度。
Data Types:fi
|single
|double
|int8
|int16
|int32
|int64
|uint8
|uint16
|uint32
|uint64
Complex Number Support: Yes
Output Arguments
C
- 输出数组
scalar | vector | matrix | multidimensional array
Output array, specified as a scalar, vector, matrix or multidimensional array.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
Any non-
fi
input must be constant; that is, its value must be known at compile time so that it can be cast to afi
目的。When you provide complex inputs to the
时代
function inside of a MATLAB®Function block, you must declare the input as complex before running the simulation. To do so, go to thePorts and data manager和set theComplexity所有已知复杂输入的参数上
.
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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éricaLatina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- 丹麦(English)
- Deutschland(Deutsch)
- España(Español)
- Finland(English)
- 法国(Français)
- 爱尔兰(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- 挪威(English)
- Österreich(Deutsch)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)