How to store indexed values from a for loop

C is a cell array with coordinate locations in "new_pts" that create polygons. I would like to collect each v for all j in an array. how might I do that?
for j=1:length(C)
frodo = C{j};
aragorn_x = new_pts(frodo,1);
aragorn_y = new_pts(frodo,2);
DT = delaunayTriangulation(aragorn_x,aragorn_y);
[K,v] = convexHull(DT);
end

 채택된 답변

Jos (10584)
Jos (10584) 2014년 7월 8일

0 개 추천

Like with C, you can store them in a cell array
v = cell(size(C))
for j=1:numel(C)
...
[K, v{j}] = convexHull(DT);
end
btw, I prefer numel over length ...

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

제품

질문:

2014년 7월 8일

답변:

2014년 7월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by