# Transform 3D data into 2D color map like Matlab's surf/imagesc

I have a bunch of 3D data (x, y coordinates and values) which is generated in Matlab and I need to render them in a 2D color map with certain axis ranges. Here are the Matlab code and the generated figure.

rho = linspace(0, 80, 100);
phi = linspace(0, 2*pi, 100);
[PHI,RHO] = meshgrid(phi, rho);
dat = rand(size(PHI)); % data was generated in cylindrical coordinate
[x, y] = pol2cart(PHI, RHO);
surf(x, y, data,'edgecolor','none'); shading interp;
view(0, 90);
axis equal; axis off;
xlim([-50, 50]); ylim([-50, 50])
save('data.mat', 'x', 'y', 'dat')


In Mathematica, I imported these data by evaluating

{x, y, dat} = Import["data.mat", "MAT"]


but I have no idea how to render them as shown above. I tried

ListPlot3D[{x, y, dat}]


It gave a 3D pattern but was extremely slow because I have a lot of data. Could anyone give me a hint to tackle this problem?

-
Could you please post the data for those of us who don't have matlab? –  s0rce Mar 11 '13 at 18:40
I guess the sample code could be: data = Flatten[ Table[{r Cos[i], r Sin[i], RandomReal[{0, Pi}]}, {i, 0, 2 Pi, 2 Pi/100.}, {r, 0, 80, 80/100.}], 1];ListDensityPlot[data, PlotRange -> {{-50, 50}, {-50, 50}}, ColorFunction -> Hue] –  halmir Mar 11 '13 at 18:52

MATLAB's surf plots a parametric surface with the point $(x_i,y_j)$ colored according to the value in $\mathrm{dat}_{i,j}$. This is easily achieved with ListDensityPlot as follows:
ListDensityPlot[Thread[Flatten /@ {x, y, dat}], PlotRange -> {{-50, 50}, {-50, 50}}]

It's probably because ListDensityPlot interpolates and tries to resample/refine it to a regular grid behind the scenes. I can't test this right now, but I'll take a look later in the day. –  The Toad Mar 11 '13 at 20:16