Notes:

meshgrid supports cartesian ('xy') and matrix ('ij') indexing conventions.
When the indexing argument is set to 'xy' (the default), the broadcasting
instructions for the first two dimensions are swapped.