Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the double-period operator in MATLAB followed by a division operator (../)?

Tags:

matlab

I am analyzing some MATLAB code where there is the following operator: ../. I cannot find any documentation on this operator explaining what it does. Can anyone explain it to me?

 sp(it,:) = (ww).*(1../sigt).*exp(-.5*(e(it,:).^2)./(sigt.^2))*srpfrac);

Just being pedantic.

like image 534
hipHopMetropolisHastings Avatar asked Nov 23 '25 22:11

hipHopMetropolisHastings


1 Answers

There is no ../ operator, the first . is associated with the 1 indicating a radix point and the ./ is element-wise division. This was likely written by someone who is used to Python where all numbers are considered integers unless the radix point is explicitly included. The more verbose equivalent is:

1.0 ./ sigt

In your case, the 0 has been omitted as it is optional.

To improve readability and future confusion, I would just change it to the following.

1 ./ sigt
like image 165
Suever Avatar answered Nov 25 '25 15:11

Suever