How to do normalize distribution technique on a simple matrix?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
motevalizadeh
il 2 Dic 2019
Commentato: Image Analyst
il 2 Dic 2019
This is just a practice about normal distribution in MATLAB and not a real project.
I created a simple matrix and want to test normal distribution on it, it's
x=[1 2 3 4 5 6 7 8 9 10 11 12 13 16 18 20 800 801 802 803 810 850]';
After that I used 'distributionFitter' Toolbox in MATLAB and plot it and as you can see it has not a normal distribution:
![nd.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/252038/nd.png)
pd = fitdist(x,'Normal');
%I change this code to have a same x_values vs x
x_values = linspace(min(x), max(x), size(x,1));
y = pdf(pd,x_values);
It works but I'm so confused about which variable is my final data? I mean I'm looking for a data who has been normal distribution?
If my codes are wrong how can I convert x to a matrix with normal distribution?
0 Commenti
Risposta accettata
Image Analyst
il 2 Dic 2019
Try this:
pd = fitdist(x, 'Normal')
% Get 1000 random numbers from this distribution:
r = pd.sigma * randn(1000) + pd.mu;
% View the histogram so we'll see that it has a normal shape.
histogram(r)
grid on;
2 Commenti
Image Analyst
il 2 Dic 2019
Yes. Isnt' that what you wanted? To generate some new values as if they were taken from the same process that generated your training data? The new random values, r, will be normally distributed as you can see from the histogram.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!