Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
the usage of dot

Subject: the usage of dot

From: Jong-Hoon Kim

Date: 22 Jan, 2012 19:36:33

Message: 1 of 3

Hi,

Would anybody explain what is the difference between "./" and "/" in the following equations?

z=3;
k = linspace(0,2,3);

prob = z .^ k * exp(-z) ./ factorial(k) = 0.0498 0.1494 0.2240
prob = z .^ k * exp(-z) / factorial(k) = 0.1826



Thanks

Subject: the usage of dot

From: dpb

Date: 22 Jan, 2012 20:04:06

Message: 2 of 3

On 1/22/2012 1:36 PM, Jong-Hoon Kim wrote:
> Hi,
> Would anybody explain what is the difference between "./" and "/"...

doc punct

--

Subject: the usage of dot

From: Roger Stafford

Date: 22 Jan, 2012 22:56:09

Message: 3 of 3

"Jong-Hoon Kim" wrote in message <jfhog1$la0$1@newscl01ah.mathworks.com>...
> Would anybody explain what is the difference between "./" and "/" in the following equations?
> z=3;
> k = linspace(0,2,3);
> prob = z .^ k * exp(-z) ./ factorial(k) = 0.0498 0.1494 0.2240
> prob = z .^ k * exp(-z) / factorial(k) = 0.1826
- - - - - - - - - -
  Look up the documentation for these two operators. They have very different meanings. The "./" operator is an element-by-element division which gives the 1 by 3 row vector answer. The other, "/", is matlab's matrix division operator which, in this case, gives the least mean square scalar, x, for approximating z.^ k*exp(-z) by x*factorial(k). As you can easily calculate, it would be x = .182552584 . For differently sized matrices "/" means different things.

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us