Anyone please help me in this un-coded code.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
What's not correct in this code that I'm unable to get curve.
close all, clc, clear all;
p = 0:0.01:0.1
for a = 1:length(p)
z = randi([0 1],1,10) % Random matrix
nz = bsc(z,0.001); % Binary symmetric channel
numerrs(a) = biterr(z,nz) % Number of errors
end
semilogy(z,nz,'b')
xlim([0 0.1])
ylim([0.0001 1])
legend('Uncoded')
xlabel('p crossover probability for the bsc')
ylabel('Probability of error')
title('Un-coded')
grid on
0 commentaires
Réponses (1)
Image Analyst
le 18 Nov 2022
Modifié(e) : Image Analyst
le 18 Nov 2022
Well, what is the value of nz? Is it a 10 element vector, or a scalar. Did you mean to give nz an index? You're overwriting z and nz on every loop iteration and then just plotting after the loop has finished, which means you'll just be plotting the last thing - last pair of z and nz.
4 commentaires
Voir également
Catégories
En savoir plus sur Wireless Communications dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!