MATLAB: Is it possible to use the boundary function for three sets of data points

boundary of a set of points

I have three sets of data points: x,y,z. I have plotted a scatter graph of (x,y) and (z,y). I now need to enclose the outer points on the graph. I am aware of the k = boundary(x,y) function but I can only use this to separately enclose two sets of data at a time, (x,y) and (z,y) separately. Is there a function I can use to enclose the outer points of all three sets of data separately? Thanks

Best Answer

Sure. Just concatenate them
allx = [x;z]; % or use comma, depending on shape
ally = [y;y];
k = coundary(allx, ally);
You might want to consider convhull() instead of boundary(), depending on what you want.