MATLAB Answers

"V = V.';" What Does This Syntax Mean?

106 ビュー (過去 30 日間)
Michael Cappello
Michael Cappello 2020 年 3 月 4 日
編集済み: Stephen Cobeldick 2020 年 3 月 4 日
The Matlab function interp2 is sprinkled with the following "V.'". For example, lines 194:196 in 2019a is
X = X.':
Y = Y.';
Z = Z.';
Why is the "." before the transpose. What does it accomplish? I've never seen this syntax before. And it doesn't seem to accomplish anything because if I let
X = rand(3,5)
then isequal(X.',X') is indeed equal.
Thanks in advance!

  0 件のコメント

サインインしてコメントする。

採用された回答

Stephen Cobeldick
Stephen Cobeldick 2020 年 3 月 4 日
編集済み: Stephen Cobeldick 2020 年 3 月 4 日
The difference is:
Several basic numeric operations have two versions, one for linear algebra (without the dot) and one for element-wise operations (with a dot). If you are not doing linear algebra then you should be using array operations (yes, this includes transpose rather than ctranspose). Read more here:
"I've never seen this syntax before."
Understanding the difference between array and matrix operations is an important step to learning MATLAB.
"And it doesn't seem to accomplish anything"
Try it on some arrays with complex numbers in them.
Note that both the ctranspose or transpose pages include at the bottom:
  • a link to the other transpose, and also
  • a link to the page explaining the difference between array and matrix operations.

  1 件のコメント

Michael Cappello
Michael Cappello 2020 年 3 月 4 日
Ahhh! I see. I tried it on an array of complex numbers and there is difference, as you say. Thanks.

サインインしてコメントする。

その他の回答 (0 件)

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by