[英]Create multiple handles and pass in function
我正在為從ginput(n)
取得的點創建多個句柄,其中n為否。 點數。 n
是來自用戶的輸入。我想為所有點創建句柄並將它們使用數組傳遞給另一個函數。 SO代碼如下所示:
n=input('Enter no. of points ');
[t]=ginput(n);
//I want to create handles for all points in t.
function DrawBezier(//pass handles to this function )
我認為一個想法是創建一個數組並在其中放置句柄。 現在傳遞該數組。
ginput
不返回句柄,但是單擊了點的坐標,因此您可以執行以下操作:
[x,y] = ginput(n); % x and y are n x 1 arrays
function DrawBezier(x,y)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.