Array that grows as elements are defined to belong to it?

2 visualizaciones (últimos 30 días)
Erik Anderson
Erik Anderson el 28 de Mzo. de 2017
Comentada: Erik Anderson el 29 de Mzo. de 2017
So, I am trying to write a function for finding the convex hull of a set of points.
I'm defining an array "H" to be the set of all points in the two-dimensional convex hull.. and would like to have the size of this array increase as I add pairs of points to it. Is there an elegant way to do this?
I am currently defining 'H=zeros(2,(n(n-1))/2)' .. in anticipation of the 'worst' case scenario, where all n choose 2 pairs of points are in the convex hull, which would necessitate trimming it down at the end. However, this seems pretty crude.

Respuestas (1)

KSSV
KSSV el 28 de Mzo. de 2017
  1 comentario
Erik Anderson
Erik Anderson el 29 de Mzo. de 2017
I see, so the answer being to define my arrays for the worst case scenario, if possible.
Thank you for your help.

Iniciar sesión para comentar.

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by