?? compgaps.m
字號:
function gaps = compgaps(frogs)
% Computes the angular difference between two consecutive frogs
global N gaps
for i = 1: N
i1 = mod(i,N);
i2 = mod(i+1,N);
if i1 == 0 %This handles the case for the computation of the gap of the Nth frog
gaps(i) = get(frogs(i2),'angle')-get(frogs(i),'angle')+360; %Calls the get method in the directory @frogc
elseif i2 == 0 %This handles the case for the computation of the gap of the (N-1)th frog
gaps(i) = get(frogs(N),'angle')-get(frogs(i),'angle');
else
gaps(i) = get(frogs(i+1),'angle')-get(frogs(i),'angle');
end
end
return
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -