How can I use fitdist function
Hello,
I tried to use the function fitdist. The only result is an error:
Undefined function ‘fitdist’ for input arguments of type ‘double’.
Error in FitaNormalDistributiontoDataExample (line 13)
pd = fitdist(x,’Normal’)
This was the result of running the code from help file: C:Users…DocumentsMATLABExamplesFitaNormalDistributiontoDataExampleFitaNormalDistributiontoDataExample.m
%% Fit a Normal Distribution to Data
% Copyright 2015 The MathWorks, Inc.
%%
% Load the sample data. Create a vector containing the patients’ weight data.
load hospital
x = hospital.Weight;
%%
% Create a normal distribution object by fitting it to the data.
pd = fitdist(x,’Normal’)
%%
% Plot the pdf of the distribution.
x_values = 50:1:250;
y = pdf(pd,x_values);
plot(x_values,y,’LineWidth’,2)
What is wrong here?Hello,
I tried to use the function fitdist. The only result is an error:
Undefined function ‘fitdist’ for input arguments of type ‘double’.
Error in FitaNormalDistributiontoDataExample (line 13)
pd = fitdist(x,’Normal’)
This was the result of running the code from help file: C:Users…DocumentsMATLABExamplesFitaNormalDistributiontoDataExampleFitaNormalDistributiontoDataExample.m
%% Fit a Normal Distribution to Data
% Copyright 2015 The MathWorks, Inc.
%%
% Load the sample data. Create a vector containing the patients’ weight data.
load hospital
x = hospital.Weight;
%%
% Create a normal distribution object by fitting it to the data.
pd = fitdist(x,’Normal’)
%%
% Plot the pdf of the distribution.
x_values = 50:1:250;
y = pdf(pd,x_values);
plot(x_values,y,’LineWidth’,2)
What is wrong here? Hello,
I tried to use the function fitdist. The only result is an error:
Undefined function ‘fitdist’ for input arguments of type ‘double’.
Error in FitaNormalDistributiontoDataExample (line 13)
pd = fitdist(x,’Normal’)
This was the result of running the code from help file: C:Users…DocumentsMATLABExamplesFitaNormalDistributiontoDataExampleFitaNormalDistributiontoDataExample.m
%% Fit a Normal Distribution to Data
% Copyright 2015 The MathWorks, Inc.
%%
% Load the sample data. Create a vector containing the patients’ weight data.
load hospital
x = hospital.Weight;
%%
% Create a normal distribution object by fitting it to the data.
pd = fitdist(x,’Normal’)
%%
% Plot the pdf of the distribution.
x_values = 50:1:250;
y = pdf(pd,x_values);
plot(x_values,y,’LineWidth’,2)
What is wrong here? fitdist error MATLAB Answers — New Questions