Questions about syntax


Below is an implementation to compute Lagrange basis in Lagrange interpolation. I understand what this is supposed to do, but I don’t understand the syntax and I would appreciate some help. Particularly, what is ‘./’ – is it some sort of division? Also, what does the function/method ‘prod()’ do?

function LagrangePoly(x, i, z)


for j=1:length(z)
    L[j]=prod( (z[j]-x[1:i-1])./(x[i]-x[1:i-1]))*prod( (z[j]-x[i+1:end])./(x[i]-x[i+1:end]))

return L


  2. Also, you can type ?prod in the Julia REPL to get the documentation for prod.


Please don’t double post, or if you do, at least link to the other discussion