MATLAB: How to create colorful surface plots from scatter data (4D)

4d plotscatterplot

I have tried to plot two perpendicular to z axis 4-D surfaces with scatter data (Color as forth dimention). It's easy to plot this surfaces but the color won't follow the ColorData and it will be depended on z-axis value which in my case will be constant value. The only way that I found for this, is using color function which I don't have it. And I also could not predict this four variables function using Matlab.
The code is as follows. I want to change it's result (first figure) to something like second figure.
x1=[2,3,2,3];
y1=[20,20,30,30];
z1=[1,1,1,1];
c1=[0.971,0.942,0.952,0.929];
x2=[2,3,2,3];
y2=[20,20,30,30];
z2=[3,3,3,3];
c2=[1.310,1.328,1.352,1.397];
scatHand=scatter3(x1,y1,z1,'filled');
set(scatHand,'CData',c1);
hold on;
scatHand=scatter3(x2,y2,z2,'filled');
set(scatHand,'CData',c2);
hold off;
Code Result:
My Desire:

Best Answer

x1=[2,3,2,3];
y1=[20,20,30,30];
z1=[1,1,1,1];
c1=[0.971,0.942,0.952,0.929];
N = 50 ;
xi = linspace(min(x1),max(x1),N) ;
yi = linspace(min(y1),max(y1),N) ;
[Xi,Yi] = meshgrid(xi,yi) ;
Zi = repmat(z1(1),size(Xi)) ;
Ci = griddata(x1,y1,c1,Xi,Yi) ;
surf(Xi,Yi,Zi,Ci) ;
shading interp