How to plot more than Pfa in shindman equation
1 次查看(过去 30 天)
显示 更早的评论
How to plot more than Pfa in shindman equation function ?
I am ploting SNR vs N
this is the code I used
N = 1:50;
Pd = 0.98;
Pfa = 1e-6;
SNR = zeros(size(N));
for m = 1:numel(N)
SNR(m) = shnidman(Pd,Pfa,m,1);
end
plot(N,SNR);
xlabel('Number of Pulses');
ylabel('SNR (dB)')
for example what if iwould lke to plot Pfa of 1e-3, 1e-7 and so on
0 个评论
回答(1 个)
Deepak Kumar
2019-10-10
Make pfa as a vector and put all the values of pfa into this e.g. Pfa = [1e-6,1e-3,1e-7];
Now use another loop to iterate through the different values of pfa vector. Basically, you can use loop within loop. The outer loop will iterate through the different values of pfa vector and the inner loop will make the plot for that particular value of pfa. I have modified your code to achieve this task. Check the code given below:
clc
clear all
close all
N = 1:50;
Pd = 0.98;
Pfa = [1e-6,1e-3,1e-7]; % put all the values of pfa here
L=length(Pfa); %get the length of pfa
for i=1:L
SNR = zeros(size(N));
for m = 1:numel(N)
SNR(m) = shnidman(Pd,Pfa(i),m,1);
end
figure(i) %make separate figure for each plot
plot(N,SNR);
xlabel('Number of Pulses');
ylabel('SNR (dB)')
title(['SNR vs No of pulses for pfa=',num2str(Pfa(i))])
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Splines 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!