Path: news.mathworks.com!not-for-mail
From: "Rajesh Acharya" <rv_acharya@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Fit quadratic polynomial and find minimum value and its site??
Date: Thu, 15 May 2008 09:27:02 +0000 (UTC)
Organization: pune
Lines: 31
Message-ID: <g0gvl6$l97$1@fred.mathworks.com>
Reply-To: "Rajesh Acharya" <rv_acharya@yahoo.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210843622 21799 172.30.248.37 (15 May 2008 09:27:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 15 May 2008 09:27:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1341120
Xref: news.mathworks.com comp.soft-sys.matlab:468531


Hello,
I have a set of data 
y = (say) 199 175 163 155 (142) 153 168 179 .. total 30 
numbers 
x= 1 2 3 4 5 ....29 30.

i fit a second order polynomial to this using polyfit and 
find the coeficients in descending order. 
 
now i want to find the 'minimum value' of 'y' and its site 
with respect to x i.e. in this data y minimum is (142) 
which is at x=5 but infact the polynomial may be reaching a 
further minimum value between x=5 and 6 say 5.2145 etc... 
how to find such a value of x at which the polynomial is 
minimum using the above polynomial????
or
is there another method to find a quadratic function which 
fits the above data and which i can solve easily to find 
minval and minsite???

 I tried 'fnmin' which requires spline/cubic fit but i did 
not succeed in getting minimum value 
this is what i did: 
   fun=spline(X,[0 Y 0]);
   [minval minsite]= fnmin(fun, X); %interval-X
for the actual data that i have (not the above one) i got 
minsite = 2 which was not the site for minval. the min 
value was at x=13 and i wanted further refinement in x... 

what could be the solution???