dot in an expression

Hi guys. What does the dot in sinc(x) = sin(x)./x do? Remove a singularity or what?

回答 (1 件)

David Fletcher
David Fletcher 2021 年 4 月 15 日
編集済み: David Fletcher 2021 年 4 月 15 日

1 投票

Element by element division

5 件のコメント

Robert Bag
Robert Bag 2021 年 4 月 15 日
but why do I not need in for instance sin(x)? isnt it already understood that this is not a matrix?
David Fletcher
David Fletcher 2021 年 4 月 15 日
編集済み: David Fletcher 2021 年 4 月 15 日
It could be a matrix - if you applied the sin function and x was a matrix it would apply sin(x) to each value in the matrix, but the way sin is applied is not fundamentally different whether x is a scaler, a vector, or a matrix, whereas x.*y is a fundamentally different method of application than x*y (element by element multiplication as opposed to matrix multiplication). In your example the dot indicates element by element division as opposed to matrix right division which is used to solve linear equations
Robert Bag
Robert Bag 2021 年 4 月 15 日
Thanks a lot. But why do i especially need it for sin(x)/x? I get an error when i but it without a dot. I thought it had stg to do with that it is not defined on x = 0?
Robert Bag
Robert Bag 2021 年 4 月 15 日
Ok read now.thnx
Adam Danz
Adam Danz 2021 年 4 月 15 日
編集済み: Adam Danz 2021 年 4 月 15 日
Compare the following
x = magic(3)
x = 3×3
8 1 6 3 5 7 4 9 2
sin(x)/x % matrix division
ans = 3×3
0.0997 -0.1770 0.1807 0.0666 0.0824 -0.1597 -0.1543 0.2902 -0.0983
sin(x)./x % element-wise division
ans = 3×3
0.1237 0.8415 -0.0466 0.0470 -0.1918 0.0939 -0.1892 0.0458 0.4546

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

質問済み:

2021 年 4 月 15 日

編集済み:

2021 年 4 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by