How do you preallocate variables for coordinates?
조회 수: 1 (최근 30일)
이전 댓글 표시
I'm trying to use ginput in multiple iterations and save the coordinates into variables...for example.
for k = 1:3
[x(i),y(i) = ginput(4);
end
So I would click 4 times for the first iteration, and save those data points into the first variable. Then, I would click 4 times for the next two iterations and save those data points in two more variables
댓글 수: 0
답변 (1개)
Youssef Khmou
2013년 5월 10일
hi, you can use cells :
for k=1:3
A{k}=ginput(4);
end
you can later transform it to matrix : " cell2mat"
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!