Array that grows as elements are defined to belong to it?
조회 수: 1 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
KSSV
2017년 3월 28일
Read this link for similar question: https://in.mathworks.com/matlabcentral/answers/21004-is-there-an-elegant-way-to-create-dynamic-array-in-matlab
참고 항목
카테고리
Help Center 및 File Exchange에서 Bounding Regions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!