【matlab】画漂亮的图(一)

%%  File: Comparison 
% 径向距离
function PlotRadialRange_SinglePulse_Rec2
close all;clear all;clc;
%% Parameters of Pulse [independent variable & arguements]
PRF = 3e3;                  % pulse repetition frequency
% PRI = 1/PRF;                % pulse repetition interval
% duty  = 15;                 % pluse duty ratio
% Tp = duty/100*PRI;          % pulse duration = (PDR)pluse duty ratio * PRI

%% transmit parameters of FDA
c = 3e8;                    % light speed
f0 = 10e9;                  % radio frequency
delta_f = PRF;       % frequency increment
Peri_num = 1;               % periocity number

%% parameters settings
Tp = [0: 0.05 : Peri_num]*1/delta_f; %time spacing 1us

%% plot Radial Range of FDA Beampattern with SinglePulse_Rec2
figure('color','w','name','RadialRange_FDABP_SinglePulse_Rec2','numbertitle','off');
    tic;% Start stopwatch timer
    dRadial = c*Tp;
    plot(Tp*1e6,dRadial*1e-3,'-+',Tp*1e6,dRadial*1e-3,'r-s');
    axis tight;
    axis([Tp(1)*1e6 Tp(end)*1e6 dRadial(1)*1e-3 dRadial(end)*1e-3]);
%     set(gca,'xlim',[Tp(1) Tp(end)],'ylim',[dRadial(1) dRadial(end)]);%X轴的数据显示范围
    set(gca,'xtick',[Tp(1)*1e6:50:Tp(end)*1e6],'ytick',[dRadial(1)*1e-3:20:dRadial(end)*1e-3]);%设置要显示坐标刻度
    xlabel('脉冲持续时间Tp [us]','fontweight','bold');ylabel('波束径向距离 [km]','fontweight','bold');
    title('Radial range','fontweight','bold');
    legend('FDA','PA');
    grid on;
    toc;   
end
【matlab】画漂亮的图(一)_第1张图片

你可能感兴趣的:(MATLAB)