I would like to create a 3D surface graph that covers all points from a point cloud [X,Y,Z]. For example, this is a scatter plot of my cloud cloud:
scatter3(X,Y,Z,5,C)

As you can see, each data point has an intensity value C.
I am now triangulating
dt = DelaunayTri(X,Y,Z);
[tri Xb]= freeBoundary(dt);
And I get a triangulated surface
figure
trisurf(tri,Xb(:,1),Xb(:,2),Xb(:,3), 'FaceColor', 'cyan', 'faceAlpha', 0.8);

However, when I try to set the surface color using
trisurf(tri,Xb(:,1),Xb(:,2),Xb(:,3),C,'EdgeAlpha',0,'FaceColor','interp')
I get an error: "Warning: color data is not set for interpolated shading" due to the fact that the size Cdoes not match Xbor tri.
How can I get the correct interpolated surface color?