MATLAB: How to surfplot from xyz coordinates

MATLABsurf

Use surf to plot the following points:
(1, 1, 1), (2, 1, 2), (3, 1, 3)
(1.1, 2, 4), (2.2, 2, 5), (3.3, 2, 4)
(1.2,3,3), (2.4, 3, 2), (3.6, 3, 1)

Best Answer

A = [1, 1, 1
2, 1, 2
3, 1, 3
1.1, 2, 4
2.2, 2, 5
3.3, 2, 4
1.2,3,3
2.4, 3,2
3.6, 3, 1] ;
x = A(:,1); y = A(:,2) ; z = A(:,3) ;
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
trisurf(tri,x,y,z)