Can I use the "fit" function from the Curve Fitting toolbox to fit data to separately defined Matlab functions?

조회 수: 2 (최근 30일)
Let's say I have a separate m-file that defines my custom function, can I use the "fit" tool with that? I see that I can use anonymous functions, but since my function is somewhat complicated and piecewise, I (think) it would be more convenient and easier to read if I wrote it separately.
It appears that the lsqcurvefit tool from the Optimization toolbox can do what I want, but I only have the Curve Fitting toolbox...
I think I may be able to do what I want with an anonymous function, but thought I'd check to see if I was missing something. Thanks for any advice.

채택된 답변

Alan Weiss
Alan Weiss 2015년 1월 12일
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 1
Scott Webster
Scott Webster 2015년 1월 12일
Ah, yes, I think I was just making it more complicated than necessary. It looks like I can just enclose the reference to my function in single quotes just like any other expression used for the fittype. Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by