How can I plot the curve of SNR in dB versus target range in Km. The following code is producing blank plots.
조회 수: 11 (최근 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
댓글 수: 0
답변 (1개)
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!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Clutter에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!