Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the matlab .' (dot-quote) notation? [duplicate]

Tags:

matlab

Trying to understand MATLAB syntax: I see that

(0:3)

is a row vector, that the ' (forward-quote) operator is transpose, so

(0:3)'

is a column vector. I have also seen .' in some files, and these also produce column vectors, so

(0:3).'

produces the same result as (0:3).

What is the difference between ' and .'? I haven't found anything in the MATLAB docs to help me understand this.

(note that this question is about syntax, primarily, not about the difference between transpose and ctranspose, because if you don't know that ' is one and .' is the other, than an answer to the question of transpose versus ctranspose is of no help answering the question of . versus '.. In many MATLAB examples and tutorials, ' is glibly and inaccurately presented as transpose, and that fact leads to the question when a user first encounters .'.)

like image 618
Reb.Cabin Avatar asked Apr 07 '15 16:04

Reb.Cabin


People also ask

What does the dot represent in Matlab?

dot(A,B,1) treats the columns of A and B as vectors and returns the dot products of corresponding columns. dot(A,B,2) treats the rows of A and B as vectors and returns the dot products of corresponding rows.

Why is dot operator used with matrix multiplication in Matlab?

Accepted AnswerThe dot indicates element-wise as opposed to array operations. See the documentation on Array vs. Matrix Operations for details.


1 Answers

There is no difference for real numbers. For complex numbers .' will produce transpose, while ' will produce the complex conjugate.

>> [i -i].'

ans =

   0.0000 + 1.0000i
   0.0000 - 1.0000i

>> [i -i]'

ans =

   0.0000 - 1.0000i
   0.0000 + 1.0000i

By the way, each Matlab operator has a name, which can be used to read the documentation.

  • .' - transpose
  • ' - ctranspose

Though it is hard to find them in the documentation sometimes. Most of them can be found in here, but you will have to guess which operator is which.

like image 185
Andrey Rubshtein Avatar answered Oct 11 '22 14:10

Andrey Rubshtein