I'm trying to get a nonlinear fit of a vector in Matlab with no success.
Let's assume that I have a vector called data:
data = [1,30,250,55,22,76]
which can be seen as a function like
f(0)=data[0]
f(1)=data[1]
and so on.
This is how it looks on WolframAlpha
I want to make a nonlinear regression of this function/array with Matlab but the documentation is not helping me as it says something about DataSet or Matrix and I don't know how to get there starting from my simple array.
So the question is:
how can I make a nonlinear regression, in Matlab, starting from a given vector that can be seen as a function?
EDIT: As an extra, is it possible to have an array containing all the residuals in this form?
residuals[0]=residual of data[0]
EDIT 2: The output should be a function like this WolframAlpha result
Create x data values
Create y data values
Create custom fit function
Fit the data
Display the coefficients
Display the residuals