필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

non linear fitting of two parameter, one parameter is never changing ...

조회 수: 1 (최근 30일)
Amin
Amin 2011년 12월 5일
마감: MATLAB Answer Bot 2021년 8월 20일
Hello, I am doing a non linear fit, my model is like this:
a = K * quad(@(x)(besselj(1.5,x)).^2 .* x./(x.^4 + t.^2) )
fitting parameters are "K" and "t". it is working fine, but it seems to fit only "t" and gives back "K" the same as I entered as the initial value. When I change K's initial value, the same value is given back but with different "t". Why this discrimination is happening?

답변 (1개)

Daniel Armyr
Daniel Armyr 2011년 12월 5일
Assuming you use fminsearch, it will only optimize on the variable x. If you want to optimize on more than one variable, you have to make x a vector, and then replace x with x(1) and t with x(2).
If you read the lower part of the documentation for fminsearch, it will tell you this, but I myself allways mess up when doing this because I forget you can only have one variable to optimize on.

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by