Anyone please help me in this un-coded code.

1 vue (au cours des 30 derniers jours)
Reema Memon
Reema Memon le 18 Nov 2022
Commenté : Walter Roberson le 18 Nov 2022
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
p = 1×11
0 0.0100 0.0200 0.0300 0.0400 0.0500 0.0600 0.0700 0.0800 0.0900 0.1000
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
z = 1×10
1 1 1 0 1 0 0 0 1 0
numerrs = 0
z = 1×10
0 0 0 0 1 1 1 1 1 1
numerrs = 1×2
0 0
z = 1×10
1 0 0 0 0 1 0 0 1 0
numerrs = 1×3
0 0 0
z = 1×10
0 0 0 0 1 0 0 0 1 0
numerrs = 1×4
0 0 0 0
z = 1×10
1 0 0 1 0 1 0 0 0 0
numerrs = 1×5
0 0 0 0 0
z = 1×10
1 1 0 1 0 1 1 1 0 1
numerrs = 1×6
0 0 0 0 0 0
z = 1×10
0 1 1 0 1 0 1 0 0 0
numerrs = 1×7
0 0 0 0 0 0 0
z = 1×10
1 1 0 1 0 0 1 1 0 0
numerrs = 1×8
0 0 0 0 0 0 0 0
z = 1×10
1 0 0 0 0 1 1 1 0 1
numerrs = 1×9
0 0 0 0 0 0 0 0 0
z = 1×10
1 1 0 0 1 0 0 1 1 1
numerrs = 1×10
0 0 0 0 0 0 0 0 0 0
z = 1×10
1 0 0 0 0 0 0 0 1 0
numerrs = 1×11
0 0 0 0 0 0 0 0 0 0 0
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

Réponses (1)

Image Analyst
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
Reema Memon
Reema Memon le 18 Nov 2022
Can you help me that where I should make changes?
Walter Roberson
Walter Roberson le 18 Nov 2022
Your code does not use the value of p, just the size of p.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Wireless Communications 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!

Translated by