?? find_index.m
字號:
function idx = find_index(v,p)% Find the index of a point in a vertices object %% Syntax:% "i = find_index(vtcs,p)"%% Description:% "find_index(vtcs,p)" returns the index of "vtcs" where the point "p"% is stored. If "p" is not contained in "vtcs", then% "find_index(vtcs,p)" returns "0".%% Examples:%%%% "a = ["%% "2 2 4 4"%% "1 3 3 1"%% "0 0 0 0];"%% "vtcs = vertices(a);"%% "i = find_index(vtcs,[4 3 0]')"%%%% returns %%%% "i = 4"%%%% See Also:% vertices,subsref% point_tol = parameters.poly_point_tol;global GLOBAL_APPROX_PARAMpoint_tol = GLOBAL_APPROX_PARAM.poly_point_tol;idx = 0;for k = 1:length(v) diff = v.list(:,k)-p; if (diff'*diff < point_tol) idx = k; break; endend
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -