How do I set a custom algebraic upper/lower bound on lsqcurvefit, instead of a constant one?

조회 수: 1 (최근 30일)
How do I set a custom algebraic upper/lower limit on lsqcurvefit, instead of a constant one? On lsqcurvefit, I can only specify a constant value as upper/lower bound, but I want to set an algebraic expression, such as (y ~ b0*x1+b1*x2) where b0+b1<1

답변 (1개)

Alan Weiss
Alan Weiss 2017년 3월 28일
For that, you will have to use lsqlin (if it is applicable) or fmincon if it is not applicable. I cannot be sure, based on your description, whether lsqlin applies.
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 2
Samuel Castro
Samuel Castro 2017년 3월 28일
Thanks Alan, I gave a linear example, but the function I want to fit will most likely be non linear. So I would need to define a a fmincon function reducing the quadratic error of it?
Alan Weiss
Alan Weiss 2017년 3월 29일
Yes, you would. See this example, which uses fminunc, but you can easily adapt it to fmincon.
Alan Weiss
MATLAB mathematical toolbox documentation

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

카테고리

Help CenterFile Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by