Significance of the (.) operator

조회 수: 6 (최근 30일)
Debdipta
Debdipta 2014년 6월 20일
답변: David Sanchez 2014년 6월 20일
When I have to integrate a function of x such as : @(x)(normpdf(x).*payoff(s(x)))
Why do I need to use the (.) operator before the (*) operator?
Can someone please help?
I am using the R2011a version

답변 (2개)

SRI
SRI 2014년 6월 20일
HI refer from this link this may will give a clear idea for you

David Sanchez
David Sanchez 2014년 6월 20일
The means the product is performed element-wise in both matrices on wither side of the product sign:
Example:
a=[1 2 3];
b=[2 3 4];
c=a.*b
c =
2 6 12
You would not need a dot this case:
d=2*a
d =
2 4 6
the multiplication factor is a scalar and it will apply to every element of a.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by