Plot of Probability Density function in MATLAB

subho · Jul 2, 2022 · 2K views
Question
I have time series data.I want to see the plot of PDF.For this, in MATLAB,I have to mention the name of the PDF-type like 'norm'.All PDF types are continuous line.But,I need discrete PDF data points plot.
Expert Answer
Profile picture of Kshitij Singh
Kshitij Singh PhD Expert
Answered Aug 19, 2026
Are you sure that you need a discrete PDF? You have not specified that your time series takes on values only in a discrete set, e.g. {0,1}.
 
Just because you have a discrete-time process, it can very well be that you should model the random variables as continuous.
 
For example:
 
x = randn(100,1);
gives a realization of a discrete-time white Gaussian noise process, but it is not a discrete random variable.
 
Do you have a specific pdf that you would like to assess for your data?
 
You can always use ksdensity to estimate the pdf
 
x = randn(100,1);
[f,xi] = ksdensity(x);
plot(xi,f);

If you want to see if your data follow a certain distribution, see histfit, or dfittool

100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!