Filter löschen
Filter löschen

How to plot more than Pfa in shindman equation

2 Ansichten (letzte 30 Tage)
Meshaal Mouawad
Meshaal Mouawad am 7 Okt. 2019
Beantwortet: Deepak Kumar am 10 Okt. 2019
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

Antworten (1)

Deepak Kumar
Deepak Kumar am 10 Okt. 2019
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

Kategorien

Mehr zu Linear and Nonlinear Regression finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by