code runs properly but the variables in workspace are not shown, How to resolve this issue?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
% Matched Filter Probability of Detection
clear
mySNR = -30:30;
find_PD_MF(10,mySNR);
function find_PD_MF(threshold,snr)
waveform = phased.LinearFMWaveform('PulseWidth',1e-4,'PRF',5e3,...
'SampleRate',1e6,'OutputFormat','Pulses','NumPulses',1,...
'SweepBandwidth',1e5);
wav = getMatchedFilter(waveform);
inputSignal = waveform();
taylorfilter = phased.MatchedFilter('Coefficients',wav,...
'SpectrumWindow','Taylor');
N= length(inputSignal);
for i = 1:length(snr)
filtredSignal_taylor = abs(taylorfilter(awgn(inputSignal,snr(i))));
PD(100) = 0;
for j=1:100
highValue = filtredSignal_taylor > threshold;
PD(j) = sum(highValue)/N;
end
Pd = sum(PD)/100;
disp(pd);
plot(snr(i),Pd,'r+');
hold on
title('Matched Filter')
xlabel('SNR (db)')
ylabel('Probaility of Detection')
end
hold off
end
0 commentaires
Réponse acceptée
Yazan
le 7 Juil 2021
find_PD_MF is a Matlab function. You declared your function without outputs. Therefore, Matlab will not return any output of your function to the workspace. Declare one or more outputs to return them to the workspace.
Example: A function that takes two inputs threshold and snr and return an output Pd to the workspace.
function Pd = find_PD_MF(threshold, snr)
% write your function
pd = threshold/snr;
end
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matched Filter and Ambiguity Function dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!