?? target_gen.m
字號:
function target = target_gen(x)
%%Target generation:
%
%This is a fuction to use with conjunction with target_image_gen.
%It basic modify the size of target to simulate an aproach.
x = round(x);
if x/2-round(x/2) == 0
x = x+1;
end
if x < 0 %Target not visible
target = zeros(11,11);
elseif x > 11
if x > 20 %Target visible
target = 6*ones(11,11);
else %Max size, now increase radius of the target
a = x - 10;
b = 5 - (a-1)/2;
q1 = zeros(b,b);
q2 = 6*ones(b,a);
target = [q1 q2 q1;
6*ones(a,11);
q1 q2 q1];
end
else %Increase size of target
a = (x-1)/2;
b = (11-x)/2;
q1 = zeros(a,a);
q2 = zeros(b,11);
q3 = zeros(11-2*b,b);
temp = [q1 6*ones(a,1) q1;
6*ones(1,x);
q1 6*ones(a,1) q1];
target = [q2;
q3 temp q3;
q2];
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -