|
"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
|