1 of 4

MATL, 2 bytes

Xy

A translation of my Octave answer.

Try it online.