필터 지우기
필터 지우기

(Curve fitting) fitting a specific equation to experimental data

조회 수: 1 (최근 30일)
Victor
Victor 2012년 3월 2일
Dear all, I have several experimental data and I know the governing nonlinear equation of these data. Now I am trying to find constants/parameters in this equation. But there are 5 unknowns in this equation. Thanks Best regards Victor

답변 (1개)

Andrei Bobrov
Andrei Bobrov 2012년 3월 2일
try nlinfit
  댓글 수: 3
Victor
Victor 2012년 3월 2일
Dear Andrei,
Thanks.
May I ask you to follow this simple example. it gives me strange error!
clc
clear
%Suppose matrix of X is experimental data and is composed of x' and y' and matrix a is unknown
%parameters and the known equation is yi = a1 + a2exp(–a3xi)
mdl = @(a,X)(X(:,2)-a(1) + a(2)*exp(-a(3)*X(:,1)));
%arbitrary guess a0 = [2;2;2]:
a = [1;3;2];
x = [0,10,20];
y= [0,5,10];
X=[x',y'];
func = mdl(a,X) ;
a0 = [2;2;2];
[ahat,r,J,cov,mse] = nlinfit(x,y,mdl,a0);
ahat

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by