Polyhedron function for detecting if points are vertices

Hello i have to detect if a point is a vertex of my polyhedron. Here is what i have for now:
function [ ] = vertexdetect (A,b,x)
%detecting the dimensions of A,b and x
if (size(x,1)~=size(A,2))
error('The dimensions of A and x don't fit')
elseif (size(b,1)~=size(A,1)
error('The dimensions of A and b don't fit')
end
if(size(A,1)<size(A,2))
disp('x is not a vertex, A has less rows than columns')
First I have to detect if x is element of my polyhedron P and secondly if x is a vertex of P. I just dont know how to detect this on P.
Can anyone help me?
Thank you in advance.
PS: the polyhedron is defined as an intersection of a finite set of closed halfspaces, P:={x in R^n | Ax<=b}

回答(1 个)

Hey, is it possible to get some help for the second step? here is the first one
if(A*x<=b)
disp(x is in P)
else
disp(x is not in P)
end

类别

帮助中心File Exchange 中查找有关 Computational Geometry 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by