draw exppdf, excdf and plot command exponential distribution in matlab
main.m
% Define the parameter for the exponential distributionlambda = 0.5; % Rate parameter% Create a vector of x values for plotting the PDF and CDFx = 0:0.01:10;
% Calculate the PDF for the exponential distributionpdf_values = exppdf(x, 1/lambda); % Note: MATLAB uses 1/lambda as the scale parameter% Calculate the CDF for the exponential distributioncdf_values = expcdf(x, 1/lambda); % Note: MATLAB uses 1/lambda as the scale parameter% Plot the PDFfigure;
plot(x, pdf_values);
title('Exponential Distribution PDF');
xlabel('x');
ylabel('Probability Density');
% Plot the CDFfigure;
plot(x, cdf_values);
title('Exponential Distribution CDF');
xlabel('x');
ylabel('Cumulative Probability');