Breaking it down a little bit - you have
delaunay(V1, V2)
Inside another call
trisurf(M1, M2, M3, M4);
The thing you were struggling with was the delaunay
call - it has two parameters as usual (V1, V2
. The only odd thing is that four numbers were added.
V1 = [-1;-1;1;1;x];
V2 = [-1;1;-1;1;y];
These four additional (x,y)
pairs represent the four corners of a square, and make sure that the figure does not have ragged edges. The same values had to be added to the X, Y, Z coordinates for the trisurf
plot so vectors corresponded.