⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 target_gen.m

📁 target image program in zip file
💻 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 + -