See also the discussion here:

https://github.com/JuliaLang/julia/issues/4093


There is a meshgrid (or ndgrid) example function available, but we decided 
against including it in Julia.  Pretty much any time you are tempted to use 
meshgrid, you would be better off using broadcasting operations, 
comprehensions, or similar constructs instead.

For example, here is how you would plot a function z(x,y) = sin(x + sin(y)) 
via PyPlot using broadcasting operations, whereas in Matlab you would 
normally need meshgrid:


x = linspace(0,2pi,100)'   # note the ': this is a row vector
y = linspace(0,4pi,200)
pcolor(x, y, sin(x .+ sin(y)))  # note the .+: the dot make it 
broadcasting, and produces a 2d array

Reply via email to