The function ksdensity() will do kernel density estimation. It's not clear to me what your x and y represent, so it's hard to give more specific advice than that.
In response to comments, here is some code with an example of 2-d kernel density estimation, with a plot of the results. Important note: this assumes that x and y are independent from each other.
x = randn(50,1);
y = randn(50,1);
[pdfx xi]= ksdensity(x);
[pdfy yi]= ksdensity(y);
[xxi,yyi] = meshgrid(xi,yi);
[pdfxx,pdfyy] = meshgrid(pdfx,pdfy);
pdfxy = pdfxx.*pdfyy;
mesh(xxi,yyi,pdfxy)
set(gca,'XLim',[min(xi) max(xi)])
set(gca,'YLim',[min(yi) max(yi)])