How to plot the figure in the while loop ?
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to plot the figure when the data is runned 10000 data ,and intergrate the four figure in one(about 8bit 10bit 12bit 14bit) .
when run 1 data , it's will be plot one figure but that's not my want . please help my code , thanks !
below is my code :
case 'JITTER & cs'
cs = linspace(2e-12 , 4e-12 , 10000)
J = linspace(0 , 5e-12 , 10000)
i =2; B_var=8;
while B_var < 15
Delta_var = (A^2)/(2^B_var);
QN = (Delta_var^2)/12;
JITTER = ((A^2)*(Win^2)*(J.*J))/2;
TN = k*T./cs;
Noise_both = JITTER+TN;
func = Psig./(QN+Noise_both);
SNR = 10*log10(func);
hold on;
figure;
plot(Noise_both,SNR);
title('SNR vs JITTER&cs')
B_var = 8+i;
end
0 comentarios
Respuestas (1)
the cyclist
el 4 de Oct. de 2021
Try putting the figure command and the hold on commands before the while loop (and put the figure command before the hold on).
If you paste your code here -- instead of an image of your code -- it would be easier to help, because we could run your code without needing to retype it all.
4 comentarios
the cyclist
el 4 de Oct. de 2021
So, my suggestion was to change your code to this:
case 'JITTER & cs'
cs = linspace(2e-12 , 4e-12 , 10000)
J = linspace(0 , 5e-12 , 10000)
i =2; B_var=8;
figure
hold on
while B_var < 15
Delta_var = (A^2)/(2^B_var);
QN = (Delta_var^2)/12;
JITTER = ((A^2)*(Win^2)*(J.*J))/2;
TN = k*T./cs;
Noise_both = JITTER+TN;
func = Psig./(QN+Noise_both);
SNR = 10*log10(func);
plot(Noise_both,SNR);
title('SNR vs JITTER&cs')
B_var = 8+i;
end
but it is not possible to test this idea, because we don't have values for
A
Win
k
T
Psig
Ver también
Categorías
Más información sobre Annotations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!