<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172245</link>
    <title>MATLAB Central Newsreader - Curve fitting - How to get polynomial of form ax^2 + 0x + 0?</title>
    <description>Feed for thread: Curve fitting - How to get polynomial of form ax^2 + 0x + 0?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 09 Jul 2008 04:06:03 -0400</pubDate>
      <title>Curve fitting - How to get polynomial of form ax^2 + 0x + 0?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172245#441946</link>
      <author>David Migl</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I am using MATLAB to fit a curve to data. I have a physics&lt;br&gt;
formula of the form y=ax^2 and I am trying to determine the&lt;br&gt;
value of the constant _a_ using the data. When I fit a&lt;br&gt;
second degree polynomial to the data (using polyfit), MATLAB&lt;br&gt;
gives me the constants a b and c of the polynomial in the&lt;br&gt;
form of ax^2 + bx + c. Of course, that doesn't help me find&lt;br&gt;
_a_ for my formula. The extra terms of power&amp;lt;2 throw me off.&lt;br&gt;
I need a polynomial of the form ax^2 + 0x + 0 that fits the&lt;br&gt;
data. How can I accomplish this?</description>
    </item>
    <item>
      <pubDate>Wed, 09 Jul 2008 04:21:02 -0400</pubDate>
      <title>Re: Curve fitting - How to get polynomial of form ax^2 + 0x + 0?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172245#441950</link>
      <author>Miroslav Balda</author>
      <description>&quot;David Migl&quot; &amp;lt;migl.spam@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;g51dfa$q8h$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I am using MATLAB to fit a curve to data. I have a physics&lt;br&gt;
&amp;gt; formula of the form y=ax^2 and I am trying to determine the&lt;br&gt;
&amp;gt; value of the constant _a_ using the data. When I fit a&lt;br&gt;
&amp;gt; second degree polynomial to the data (using polyfit), MATLAB&lt;br&gt;
&amp;gt; gives me the constants a b and c of the polynomial in the&lt;br&gt;
&amp;gt; form of ax^2 + bx + c. Of course, that doesn't help me find&lt;br&gt;
&amp;gt; _a_ for my formula. The extra terms of power&amp;lt;2 throw me off.&lt;br&gt;
&amp;gt; I need a polynomial of the form ax^2 + 0x + 0 that fits the&lt;br&gt;
&amp;gt; data. How can I accomplish this?&lt;br&gt;
&lt;br&gt;
Hi&lt;br&gt;
Very simply. Your problem is a special form of polynomial.&lt;br&gt;
The coefficient a may be found by the statement&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a = x(:).^2\y(:);&lt;br&gt;
&lt;br&gt;
It is a reduced form of the polynomial fit, coefficient of&lt;br&gt;
which can be found from the formula (should x and y be&lt;br&gt;
column vectors)&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c = [ones(size(x)), x, x.^2, x.^3,...]\y&lt;br&gt;
&lt;br&gt;
Have a nice day.&lt;br&gt;
Mira</description>
    </item>
    <item>
      <pubDate>Wed, 09 Jul 2008 04:30:20 -0400</pubDate>
      <title>Re: Curve fitting - How to get polynomial of form ax^2 + 0x + 0?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172245#441951</link>
      <author>David Migl</author>
      <description>&quot;Miroslav Balda&quot; &amp;lt;balda.nospam@cdm.it.cas.cz&amp;gt; wrote in&lt;br&gt;
message &amp;lt;g51ebe$438$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;David Migl&quot; &amp;lt;migl.spam@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;g51dfa$q8h$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Hi,&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I am using MATLAB to fit a curve to data. I have a physics&lt;br&gt;
&amp;gt; &amp;gt; formula of the form y=ax^2 and I am trying to determine the&lt;br&gt;
&amp;gt; &amp;gt; value of the constant _a_ using the data. When I fit a&lt;br&gt;
&amp;gt; &amp;gt; second degree polynomial to the data (using polyfit), MATLAB&lt;br&gt;
&amp;gt; &amp;gt; gives me the constants a b and c of the polynomial in the&lt;br&gt;
&amp;gt; &amp;gt; form of ax^2 + bx + c. Of course, that doesn't help me find&lt;br&gt;
&amp;gt; &amp;gt; _a_ for my formula. The extra terms of power&amp;lt;2 throw me off.&lt;br&gt;
&amp;gt; &amp;gt; I need a polynomial of the form ax^2 + 0x + 0 that fits the&lt;br&gt;
&amp;gt; &amp;gt; data. How can I accomplish this?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Hi&lt;br&gt;
&amp;gt; Very simply. Your problem is a special form of polynomial.&lt;br&gt;
&amp;gt; The coefficient a may be found by the statement&lt;br&gt;
&amp;gt;      &lt;br&gt;
&amp;gt;      a = x(:).^2\y(:);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; It is a reduced form of the polynomial fit, coefficient of&lt;br&gt;
&amp;gt; which can be found from the formula (should x and y be&lt;br&gt;
&amp;gt; column vectors)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;      c = [ones(size(x)), x, x.^2, x.^3,...]\y&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Have a nice day.&lt;br&gt;
&amp;gt; Mira&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Thank you very much for your reply; I can almost comprehend&lt;br&gt;
it; forgive my ignorance, but could you please tell me what&lt;br&gt;
x and y represent?</description>
    </item>
    <item>
      <pubDate>Wed, 09 Jul 2008 04:54:02 -0400</pubDate>
      <title>Re: Curve fitting - How to get polynomial of form ax^2 + 0x + 0?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172245#441953</link>
      <author>Miroslav Balda</author>
      <description>&quot;David Migl&quot; &amp;lt;migl.spam@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;g51ess$8bo$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
:&lt;br&gt;
SNIP&lt;br&gt;
:&lt;br&gt;
&amp;gt; Thank you very much for your reply; I can almost comprehend&lt;br&gt;
&amp;gt; it; forgive my ignorance, but could you please tell me what&lt;br&gt;
&amp;gt; x and y represent?&lt;br&gt;
&lt;br&gt;
(x,y) are coordinates of your observations (points). &lt;br&gt;
x is column vector of independent variable values, and&lt;br&gt;
y is a column vector of the same size as x of values of&lt;br&gt;
dependent variable.&lt;br&gt;
&lt;br&gt;
Mira</description>
    </item>
    <item>
      <pubDate>Wed, 09 Jul 2008 05:01:03 -0400</pubDate>
      <title>Re: Curve fitting - How to get polynomial of form ax^2 + 0x + 0?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172245#441954</link>
      <author>David Migl</author>
      <description>Ah, I knew it had to be something simple like that. I tried&lt;br&gt;
the formula you gave me and it worked out perfectly; I&lt;br&gt;
extend my deepest gratitude to your for your help as I&lt;br&gt;
couldn't have figured it out otherwise.</description>
    </item>
  </channel>
</rss>

