In a new worksheet with 3 columns, fill with random numbers and set col(C) as Z. Make a contour plot then right click the plot and select Generate Grid. Set X Grid Size as 31 and output as Matrix. Right click the upper-left corner and set the dimension to open the dialog. Since Origin 2016, it would output the x as y and the y as x.
Fixed in Origin 2025