curve fit using a custom equation from command line without using cftool
up vote
1
down vote
favorite
I have some data that is curve fitting nicely using custom equation from cftool. The equation is: y = aexp(-bx)+c. Is there any way to make this same equation available from the command line? For instance using fit command and exp1 gives following results:
f = fit(time,T102,'exp1')
f =
General model Exp1:
f(x) = a*exp(b*x)
Coefficients (with 95% confidence bounds):
a = 0.0726 (0.0717, 0.0735)
b = -1.263e-05 (-4.171e-05, 1.645e-05)
However the form of this equation does not fit my data well. I need to have the equation as f(x) = aexp(bx) + c. I am aware that I can get it from cftool but I have many different sets of data to curve fit (~30) and I just want a, b, and c returned from by MATLAB in the custom equation f(x) = aexp(bx) + c.
matlab curve-fitting
add a comment |
up vote
1
down vote
favorite
I have some data that is curve fitting nicely using custom equation from cftool. The equation is: y = aexp(-bx)+c. Is there any way to make this same equation available from the command line? For instance using fit command and exp1 gives following results:
f = fit(time,T102,'exp1')
f =
General model Exp1:
f(x) = a*exp(b*x)
Coefficients (with 95% confidence bounds):
a = 0.0726 (0.0717, 0.0735)
b = -1.263e-05 (-4.171e-05, 1.645e-05)
However the form of this equation does not fit my data well. I need to have the equation as f(x) = aexp(bx) + c. I am aware that I can get it from cftool but I have many different sets of data to curve fit (~30) and I just want a, b, and c returned from by MATLAB in the custom equation f(x) = aexp(bx) + c.
matlab curve-fitting
1
Is this link helpful? stackoverflow.com/questions/10890438/…
– James Phillips
Nov 11 at 20:05
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have some data that is curve fitting nicely using custom equation from cftool. The equation is: y = aexp(-bx)+c. Is there any way to make this same equation available from the command line? For instance using fit command and exp1 gives following results:
f = fit(time,T102,'exp1')
f =
General model Exp1:
f(x) = a*exp(b*x)
Coefficients (with 95% confidence bounds):
a = 0.0726 (0.0717, 0.0735)
b = -1.263e-05 (-4.171e-05, 1.645e-05)
However the form of this equation does not fit my data well. I need to have the equation as f(x) = aexp(bx) + c. I am aware that I can get it from cftool but I have many different sets of data to curve fit (~30) and I just want a, b, and c returned from by MATLAB in the custom equation f(x) = aexp(bx) + c.
matlab curve-fitting
I have some data that is curve fitting nicely using custom equation from cftool. The equation is: y = aexp(-bx)+c. Is there any way to make this same equation available from the command line? For instance using fit command and exp1 gives following results:
f = fit(time,T102,'exp1')
f =
General model Exp1:
f(x) = a*exp(b*x)
Coefficients (with 95% confidence bounds):
a = 0.0726 (0.0717, 0.0735)
b = -1.263e-05 (-4.171e-05, 1.645e-05)
However the form of this equation does not fit my data well. I need to have the equation as f(x) = aexp(bx) + c. I am aware that I can get it from cftool but I have many different sets of data to curve fit (~30) and I just want a, b, and c returned from by MATLAB in the custom equation f(x) = aexp(bx) + c.
matlab curve-fitting
matlab curve-fitting
asked Nov 11 at 12:54
PatStarks
5610
5610
1
Is this link helpful? stackoverflow.com/questions/10890438/…
– James Phillips
Nov 11 at 20:05
add a comment |
1
Is this link helpful? stackoverflow.com/questions/10890438/…
– James Phillips
Nov 11 at 20:05
1
1
Is this link helpful? stackoverflow.com/questions/10890438/…
– James Phillips
Nov 11 at 20:05
Is this link helpful? stackoverflow.com/questions/10890438/…
– James Phillips
Nov 11 at 20:05
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
I ended up finding my answer using information from following link:
https://www.mathworks.com/help/curvefit/fit.html
Create a matlab function that contains custom equation for fit
function y = CustomCurveFitFunction(x,a,b,c)
y = aexp(-bx) + c;
end
Call the function in the following manner from MATLAB
ft = fittype('CustomCurveFitFunction(x, a, b, c)');
f = fit(time, y, ft);
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
I ended up finding my answer using information from following link:
https://www.mathworks.com/help/curvefit/fit.html
Create a matlab function that contains custom equation for fit
function y = CustomCurveFitFunction(x,a,b,c)
y = aexp(-bx) + c;
end
Call the function in the following manner from MATLAB
ft = fittype('CustomCurveFitFunction(x, a, b, c)');
f = fit(time, y, ft);
add a comment |
up vote
1
down vote
I ended up finding my answer using information from following link:
https://www.mathworks.com/help/curvefit/fit.html
Create a matlab function that contains custom equation for fit
function y = CustomCurveFitFunction(x,a,b,c)
y = aexp(-bx) + c;
end
Call the function in the following manner from MATLAB
ft = fittype('CustomCurveFitFunction(x, a, b, c)');
f = fit(time, y, ft);
add a comment |
up vote
1
down vote
up vote
1
down vote
I ended up finding my answer using information from following link:
https://www.mathworks.com/help/curvefit/fit.html
Create a matlab function that contains custom equation for fit
function y = CustomCurveFitFunction(x,a,b,c)
y = aexp(-bx) + c;
end
Call the function in the following manner from MATLAB
ft = fittype('CustomCurveFitFunction(x, a, b, c)');
f = fit(time, y, ft);
I ended up finding my answer using information from following link:
https://www.mathworks.com/help/curvefit/fit.html
Create a matlab function that contains custom equation for fit
function y = CustomCurveFitFunction(x,a,b,c)
y = aexp(-bx) + c;
end
Call the function in the following manner from MATLAB
ft = fittype('CustomCurveFitFunction(x, a, b, c)');
f = fit(time, y, ft);
answered Nov 12 at 5:06
PatStarks
5610
5610
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248948%2fcurve-fit-using-a-custom-equation-from-command-line-without-using-cftool%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Is this link helpful? stackoverflow.com/questions/10890438/…
– James Phillips
Nov 11 at 20:05