# Problem using minboundquad function to create a minimum bounding quadrilateral for a given pointset

4 views (last 30 days)
Gowtham HariHara on 18 May 2021
Answered: Gowtham HariHara on 26 May 2021
I had modified one line in the minboundquad.m function to remove the collinear edges in the pointset.
from
edges = convhull(x,y);
to
edges = convhull(x,y,'Simplify',true);
The main code is
x = points2(:,1);
y = points2(:,2);
Result I got is below.
There is some error I could not find out. Can someone help me solve this?

Gowtham HariHara on 26 May 2021
Modifying the line in minboundquad.m from
to
if (( A_i < quadarea)&& all(abs([qxi qyi]) < 1e15))
resolves the issue.
Thanks to @Michael Sapper for this suggestion(found in comment section of this toolbox)

Shiva Kalyan Diwakaruni on 26 May 2021
Hi,
I did not seem to find any error while reproducing and I got the below result after changing minboundquad.m
from
edges = convhull(x,y);
to
edges = convhull(x,y,'Simplify',true);
I got the Warning: Matrix is close to singular or badly scaled. Results may be inaccurate.
Can You explain what your error was?
##### 2 CommentsShowHide 1 older comment
Gowtham HariHara on 26 May 2021
@Shiva Kalyan Diwakaruni Do you want to see the expected outcome of this function ?
This function worked for one of the less complex pointset. If you would like to see the result for a working pointset, I can show a screenshot.

### Categories

Find more on Numeric Types in Help Center and File Exchange

R2018b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by