How can I plot the curve of SNR in dB versus target range in Km. The following code is producing blank plots.

14 次查看(过去 30 天)
% MATLAB Code
% Generated by MATLAB 9.9 and Phased Array System Toolbox 4.4
% Generated on 27-Feb-2021 20:11:40
% All quantities are in standard units
wavelen = 0.04; % Wavelength (m)
pwidth = 8e-08; % Pulse width (s)
sysloss = 10; % System losses (dB)
noisetemp = 290; % Noise temperature (K)
rcs = 1; % Target radar cross section (m^2)
gain = 30; % Gain (dB)
tgtrng = 20000; % Target range (m)
pkpow = 100000; % Peak transmit power (W)
snr = radareqsnr(wavelen, tgtrng, pkpow, pwidth,'rcs', rcs, 'gain', ...
gain, 'loss', sysloss, 'Ts', noisetemp);
plot(tgtrng,snr)
grid on

回答(1 个)

KALYAN ACHARJYA
KALYAN ACHARJYA 2021-2-28
编辑:KALYAN ACHARJYA 2021-2-28
The plot variables data are scalar (Single data), is there any sense? Like
x=4;
y=7;
plot(x,y);
There is a single dot in the plot (you need to observe it carefully)
To plot the data, you need to vary the x variable with multiple values or range of values, like
wavelen = 0.04; % Wavelength (m)
pwidth = 8e-08; % Pulse width (s)
sysloss = 10; % System losses (dB)
noisetemp = 290; % Noise temperature (K)
rcs = 1; % Target radar cross section (m^2)
gain = 30; % Gain (dB)
tgtrng = 1:20000; % Target range (m)
pkpow = 100000;
snr_data=zeros(1,length(tgtrng)); %Memory Preallocation
for i=1:length(tgtrng)
snr_data(i)= radareqsnr(wavelen, tgtrng(i), pkpow, pwidth,'rcs', rcs, 'gain', ...
gain, 'loss', sysloss, 'Ts', noisetemp);
end
plot(tgtrng,snr_data)
grid on
What I changed here is just change the x (tgtrng in code) from 1 to 20000, and calculate the SNR according to all the values of tgtrng, afterwards store the snr in an array and latter plot two vector data tgtrng and snr. Or Do modify as per your requirements.
More and Important: Please avoid using the MATLAB inbuilt function as a variable name (possibility of conflicts), so I renamed the snr variable to snr_data.
Hope it helps!

类别

Help CenterFile Exchange 中查找有关 Environment and Clutter 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by