Error shown is Error picture
%x = randn(50,1);
%y = randn(50,1);
points=importdata('points1.txt');
x=points(:,1);
y=points(:,2);
[qx,qy] = minboundquad(x,y);
plot(x,y,'ro',qx,qy,'b-')
The function is working for randomly generated points but not working for my pointset. Can someone please help me solve this? This is the function minboundquad in Matlab
Or Please lead/help me to find a minimum bounding quadrilateral for a given set of points
Modifying these lines in minboundquad.m from
edges = convhull(x,y);
to
edges = convhull(x,y,'Simplify',true);
and
if ( A_i < quadarea)
to
if (( A_i < quadarea)&& all(abs([qxi qyi]) < 1e15))
resolves the issue.