How to do normal distribution for same data?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
RoBoTBoY
am 16 Nov. 2022
Kommentiert: Star Strider
am 16 Nov. 2022
Hello,
According with first example from here: https://www.mathworks.com/help/stats/normal-distribution.html
I wrote these lines below, but maybe i'm doing something wrong.
%Import front sonar for 30cm:
sonar_F_030 = readtable('sonar_F_030.csv');
%Split ranges from file
range = sonar_F_030.range;
pd = fitdist(range,'Normal');
mu1 = pd.mu;
sigma1 = pd.sigma;
x = (-3:.1:3);
y = normpdf(range,mu1,sigma1);
plot(x,y)
How can I do normal distribution for these data;
0 Kommentare
Akzeptierte Antwort
Star Strider
am 16 Nov. 2022
Try something like this —
%Import front sonar for 30cm:
sonar_F_030 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1195733/sonar_F_030.csv')
%Split ranges from file
range = sonar_F_030.range;
pd = fitdist(range,'Normal');
mu1 = pd.mu;
sigma1 = pd.sigma;
% x = (-3:0.01:3);
x = linspace(min(range), max(range)+0.01, numel(range));
y = normpdf(x,mu1,sigma1);
figure
plot(x,y)
grid
Make appropriate changes to get the desired result.
.
2 Kommentare
Weitere Antworten (1)
Torsten
am 16 Nov. 2022
%Import front sonar for 30cm:
sonar_F_030 = readtable("https://de.mathworks.com/matlabcentral/answers/uploaded_files/1195733/sonar_F_030.csv");
%Split ranges from file
range = sonar_F_030.range;
pd = fitdist(range,'Normal');
mu1 = pd.mu
sigma1 = pd.sigma
x = (0.29:.0001:0.315);
y = normpdf(x,mu1,sigma1);
plot(x,y)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!