What does operator “dot” (.) mean?
2015-04-15 08:51
155 查看
Question:
Given the code :
The output :
But if I do this :
The output is :
What does the operator
Answer:
The dot itself is not an operator,
The
pointwise product.
C.f.
"Matrix and array arithmetic": http://www.mathworks.de/help/techdoc/ref/arithmeticoperators.html "Pointwise": http://en.wikipedia.org/wiki/Pointwise "Element-Wise Operations": http://www.glue.umd.edu/afs/glue.umd.edu/system/info/olh/Numerical/Matlab_Matrix_Manipulation_Software/Matrix_Vector_Operations/elementwise ¹) Hence the dot.
Given the code :
A = [1 2 3; 3 2 1] B = A.^2
The output :
B = 1 4 9 9 4 1
But if I do this :
B = A^2
The output is :
Error using ^ Inputs must be a scalar and a square matrix. To compute elementwise POWER, use POWER (.^) instead.
What does the operator
.do exactly ?
Answer:
The dot itself is not an operator,
.^is.
The
.^is a pointwise¹ (i.e. element-wise) power, as
.*is the
pointwise product.
.^Array power.
A.^Bis the matrix with elements
A(i,j)to the
B(i,j)power.
Aand
Bmust have the same size, unless one of them is a scalar.
C.f.
"Matrix and array arithmetic": http://www.mathworks.de/help/techdoc/ref/arithmeticoperators.html "Pointwise": http://en.wikipedia.org/wiki/Pointwise "Element-Wise Operations": http://www.glue.umd.edu/afs/glue.umd.edu/system/info/olh/Numerical/Matlab_Matrix_Manipulation_Software/Matrix_Vector_Operations/elementwise ¹) Hence the dot.
相关文章推荐
- "Batch,Batch,Batch":What does it really mean?
- what-does-scalable-database-mean
- What does "size" in int(size) of MySQL mean?
- What does enumerable mean?
- What does "Rxlch" mean in ENCODE?
- Constraints on Type Parameters (what does where T : class mean)
- (Kattis - heritage)What Does It Mean?(map+记忆话搜索)(补)
- (转载)What does (Aborted) mean in HttpWatch?
- "Batch,Batch,Batch":What does it really mean?
- What does "Error: L6248E: cannot have address type relocation" mean?
- What does Using filesort mean in MySQL?
- What does '>/dev/null 2>&1' mean in this article of crontab basics
- What does => and () => mean in Scala
- What is SynchronizationContext, and what does it mean to capture and use it?
- What does > /dev/null 2>&1 mean?
- why we use _MainText_ST and what does the mean of TRANSFORM_TEX
- When we call objective c is runtime language what does it mean? 我们说的oc是动态运行时语言是什么意思?
- What does the [Flags] Enum Attribute mean in C#?
- What does mean RSS, Atom, OPML...?
- What does “java: No match.” mean?