plottarget.m

来自「实现了雷达系统的基本仿真」· M 代码 · 共 24 行

M
24
字号
function h = plotTarget( target,handles)
% This function plots a target in the radar display

    x = target.pos(1);
    y = target.pos(2);
%     targetsAngle = mod(atan2(y,x),2*pi);
    targetsAngle = atan2(y,x);
    v = target.v;
    switch v
    case 12345
        % This target was detected without MTI so it isn't known if it is
        % clutter or plane...
        c = 'r';
        h = plot(handles.radarDisplay, x,y,'X','MarkerSize',7,'linewidth',2,'tag','foundTarget','color',c);
    case 0
        % this is clutter (mountain)
        h = plot(handles.radarDisplay,x,y,'^k','MarkerFaceColor','k','tag','foundTarget');
    otherwise
        yDir = -sign(y);
        xDir = -1;
        h = quiver(handles.radarDisplay,x,y,xDir*v*cos(targetsAngle),yDir*v*abs(sin(targetsAngle)),20,...
            'color','r','linewidth',1,'marker','X','MarkerSize',7,'tag','foundTarget');
    end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?