Try this:
clc;
close all;
rng('default');
datapoints{1} = exprnd(1 , [5,1]);
datapoints{2} = exprnd(1 , [50,1]);
datapoints{3} = exprnd(1 , [500,1]);
datapoints{4} = exprnd(1 , [5000,1]);
for i=1:numel(datapoints)
ax = subplot(2,2,i);
histogram(datapoints{i});
dist = fitdist(datapoints{i}, 'Exponential');
x_points = linspace(0, ax.XLim(2), 100);
Pdf = pdf(dist, x_points);
Cdf = cdf(dist, x_points);
yyaxis right
hold on
plot(x_points, Pdf, 'r', 'LineWidth', 2, 'DisplayName', 'PDF');
plot(x_points, Cdf, 'b', 'LineWidth', 2, 'DisplayName', 'CDF');
legend
end
Result: