Convhull(G) non-determinate solution from a set of planes

3 views (last 30 days)
I have a problem when using a function that calls convhull.
I am using a function which was written by somebody else, called ConvexPolytrope.m- attached. This works out the convex shape that bounds half-spaces.
The input to this code is a matrix where each row is the coefficients of the half-space equation, plus an 'inner point' which the algorithm needs as a starting point.
So, in the end, I have 8 planes to which the polytrope is a solution. 2 of these define the half spaces- they are defined by my original problem, and geometrically they are planes that intersect a box formed by 6 planes that are defined by bounding limits on my variables in the plane equations.
Then there are 6 half spaces- it is simplest to choose these to be the faces of a cuboid, where one of the variables in the plane system has it's lower/upper bound.
I do this, and I am pretty sure my set of half planes is consistently defined. However, with the following input, which is supposed to be the 6 'bounding planes',
convexPolytrope([0,-1,0,-2500; 0,1,0,-2000; 0,0,-1,-50; 0,0,1,-25; -1,0,0,-2500; 1,0,0,-2000;],[0.5,0.5,0.5])
I get the same kind of output that I originally posted about
ans = [4x3 double] [4x3 double] [4x3 double] [4x3 double] [4x3 double] [4x3 double]
It's worse if I additionally supply the two planes,
convexPolytrope([1,1,-1,0; 1,0,-1,0; 0,-1,0,-2500; 0,1,0,-2000; 0,0,-1,-50; 0,0,1,-25; -1,0,0,-2500; 1,0,0,-2000;],[-0.5 -0.5 -0.5])
Error using cgprechecks (line 30) Data points containing Inf or NaN are not supported.
Error in convhulln (line 41) cgprechecks(x, nargin, cg_opt);
Error in convexPolytrope (line 38) K = convhulln(G);
What is wrong with my input that could produce the 'NaN or 'Inf' error?
It could be my choice of the inner point (second argument to the function) but I do not know in advance the required values for this based on the other input.

Answers (0)

Community Treasure Hunt

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

Start Hunting!