help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Curve fitting of data from text file


From: socware
Subject: Curve fitting of data from text file
Date: Wed, 24 Mar 2010 06:38:38 -0800 (PST)

Hello,
I want to do curve fitting and get the value of the coefficients which gives
me minimum error for the equation:

I_d=a*(V_g-b)^2   %the value of I_d and V_g I get from the two columns of a
text file. I have around 2000 values of I_d & V_g, basically trying to fit
the data from transistor I-V curve.

I have a pseudo code which will give an idea what I want to do.

i,j=0
V_g= data from 2nd column of text file
I_d= data from 1st column of text file
for a=a0/10 to a0*10                # the value of a0 can be between some
range like 100 to 10000
  i=i+1
  for b=b0/10 to b0*10              # the value of b0 can be between some
range like 30 to 3000
    j=j+1
    I_dfit(1:size(V_g))=a*(V_g-b)^2     # functione to get best fit? if
polyfit then how do I implement here.
    error(i,j)=sum( (I_fit(1:size(V_g))-I_d(1:size(V_g)))^2 )
  end
end
bestIandJ=findminimum(error)



Any suggestion how do I proceed.? 

Thanks
-- 
View this message in context: 
http://n4.nabble.com/Curve-fitting-of-data-from-text-file-tp1680640p1680640.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]