Graph prints more lines than it should
Ältere Kommentare anzeigen
Hi!
I have this code:
mu = 0;
sigma = 1;
pd = makedist('Normal',mu,sigma);
fileID1 = fopen('TLSDeliveryTime.txt', 'r');
fileID2 = fopen('X509DeliveryTime.txt', 'r');
fileID3 = fopen('OCSPDeliveryTime.txt', 'r');
formatSpec = '%f';
x1 = fscanf(fileID1,formatSpec);
fclose(fileID1);
nbins=100;
[h, binedges] = hist(x1, nbins);
tlsNormalized = h / sum(h);
cdf = cumsum(tlsNormalized);
plot(cdf)
semilogx(binedges, cdf,'LineWidth',2)
hold on
x2 = fscanf(fileID2,formatSpec);
fclose(fileID2);
[h2, binedges2] = hist(x2,nbins);
x509Normalized = h2 / sum(h2);
cdf2 = cumsum(x509Normalized);
plot(cdf2)
semilogx(binedges2, cdf2,'LineWidth',2)
hold on
x3 = fscanf(fileID3,formatSpec);
[h3, binedges3] = hist(x3,nbins);
ocspNormalized = h3 / sum(h3);
cdf3 = cumsum(ocspNormalized);
plot(cdf3)
semilogx(binedges3,cdf3,'LineWidth',2)
fclose(fileID3);
[h3, binedges3] = hist(x3,nbins);
ocspNormalized = h3 / sum(h3);
cdf3 = cumsum(ocspNormalized);
plot(cdf3)
semilogx(binedges3,cdf3,'LineWidth',2)
hold off
%set(gca,'xscale','log')
xlabel('Delivery time (ms)');
ylabel('CDF (%)');
ylim([0,1]);
legend('TLS','X509','OCSP')
and when I plot the graph, I get this:

It should only plot 3 lines(TLS,X509,OCSP), why does it plot more lines?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Line Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!