<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255197</link>
    <title>MATLAB Central Newsreader - Fixed point Iteration (multivariable) 2</title>
    <description>Feed for thread: Fixed point Iteration (multivariable) 2</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>Thu, 02 Jul 2009 17:15:21 -0400</pubDate>
      <title>Fixed point Iteration (multivariable) 2</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255197#662285</link>
      <author>Sean Douglas</author>
      <description>Hello I am trying to perform fixed point iteration on this problem:&lt;br&gt;
&amp;nbsp;x1=g1(x1,x2)=(x1^2+x2^2+8)/10,   x2=g2(x1,x2)=(x1*x2^2+x1+8)/10&lt;br&gt;
&amp;nbsp;&lt;br&gt;
first I made it one variable since I am x1 and x2 will be equal to each other anyways.                  Here is my mfile:&lt;br&gt;
%Computes approximate solution of g(x)=x&lt;br&gt;
%Input: inline function g, starting guess x0, &lt;br&gt;
%       number of steps k&lt;br&gt;
%Output: Approximate solution xc&lt;br&gt;
function xc=fpi(g,x0,k)&lt;br&gt;
x(1)=x0;&lt;br&gt;
for i=1:k&lt;br&gt;
&amp;nbsp;&amp;nbsp;x(i+1)=g(x(i));&lt;br&gt;
end&lt;br&gt;
x'                 %transpose output to a column&lt;br&gt;
xc=x(k+1);&lt;br&gt;
&lt;br&gt;
then I defined x and did the inline function: &lt;br&gt;
&amp;gt;&amp;gt; clear&lt;br&gt;
&amp;gt;&amp;gt; x=-10:.001:10;&lt;br&gt;
&amp;gt;&amp;gt; x=fpi(inline('((x.^2+x.^2+8)/10)'),.5,2)&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.5000&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.8500&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.9445&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
x =&lt;br&gt;
&lt;br&gt;
0.9445	this worked nicely&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Now I am trying to do this how the question was set up (with mulivariables). I changed my mfile and tried to do it. Here is what I have been up to:&lt;br&gt;
First here is my new modified mfile:&lt;br&gt;
%Attempting to set up multivariable Fixed-Point Iteration&lt;br&gt;
%Computes approximate solution of g(x)=x&lt;br&gt;
%Input: inline function g, starting guess x0, &lt;br&gt;
%       number of steps k&lt;br&gt;
%Output: Approximate solution xc&lt;br&gt;
function xc=fpi(g,x0,y0,k)&lt;br&gt;
x(1)=(x0,y0);&lt;br&gt;
for i=1:k&lt;br&gt;
&amp;nbsp;&amp;nbsp;x(i+1)=g(x(i),y(i));&lt;br&gt;
end&lt;br&gt;
x'                 %transpose output to a column&lt;br&gt;
xc=x(k+1);&lt;br&gt;
&lt;br&gt;
&amp;#8230; and here is me calling the function and the MATLAB response&lt;br&gt;
&amp;gt;&amp;gt; clear&lt;br&gt;
x=-10:.001:10;&lt;br&gt;
y=-10:.001:10;&lt;br&gt;
&amp;gt;&amp;gt; x=fpixy(inline('((x.^2+y.^2+8)/10)'),.5,.5,2)&lt;br&gt;
??? Error: File: fpixy.m Line: 7 Column: 9&lt;br&gt;
Expression or statement is incorrect--possibly unbalanced (, {, or [.&lt;br&gt;
&lt;br&gt;
I am pretty sure that it is not unbalaced, but something must be wrong with line 7 of my mfile, which is:  x(1)=(x0,y0);&lt;br&gt;
&lt;br&gt;
Can I even do a multivariable FPI?&lt;br&gt;
I hope I described my situation clearly. Thanks for any help.</description>
    </item>
    <item>
      <pubDate>Thu, 02 Jul 2009 19:58:53 -0400</pubDate>
      <title>Re: Fixed point Iteration (multivariable) 2</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255197#662349</link>
      <author>Steve Conahan</author>
      <description>Hi Sean,&lt;br&gt;
&lt;br&gt;
&amp;gt; ??? Error: File: fpixy.m Line: 7 Column: 9&lt;br&gt;
&lt;br&gt;
As indicated, Line: 7 needs some re-writing:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;x(1)=(x0,y0);&lt;br&gt;
&lt;br&gt;
I am not exactly sure what you are trying to do, but I suspect that the &lt;br&gt;
right hand side of the above equation is not written correctly...perhaps you &lt;br&gt;
need square braces [ instead of parentheses ( on the right hand side...&lt;br&gt;
&lt;br&gt;
hth,&lt;br&gt;
Steve&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Sean Douglas&quot; &amp;lt;seanjdouglas@hotmail.com&amp;gt; wrote in message &lt;br&gt;
news:h2ipv9$h8m$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; Hello I am trying to perform fixed point iteration on this problem:&lt;br&gt;
&amp;gt; x1=g1(x1,x2)=(x1^2+x2^2+8)/10,   x2=g2(x1,x2)=(x1*x2^2+x1+8)/10&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; first I made it one variable since I am x1 and x2 will be equal to each &lt;br&gt;
&amp;gt; other anyways.                  Here is my mfile:&lt;br&gt;
&amp;gt; %Computes approximate solution of g(x)=x&lt;br&gt;
&amp;gt; %Input: inline function g, starting guess x0,&lt;br&gt;
&amp;gt; %       number of steps k&lt;br&gt;
&amp;gt; %Output: Approximate solution xc&lt;br&gt;
&amp;gt; function xc=fpi(g,x0,k)&lt;br&gt;
&amp;gt; x(1)=x0;&lt;br&gt;
&amp;gt; for i=1:k&lt;br&gt;
&amp;gt;  x(i+1)=g(x(i));&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; x'                 %transpose output to a column&lt;br&gt;
&amp;gt; xc=x(k+1);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; then I defined x and did the inline function:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; clear&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; x=-10:.001:10;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; x=fpi(inline('((x.^2+x.^2+8)/10)'),.5,2)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ans =&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;    0.5000&lt;br&gt;
&amp;gt;    0.8500&lt;br&gt;
&amp;gt;    0.9445&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; x =&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 0.9445 this worked nicely&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Now I am trying to do this how the question was set up (with &lt;br&gt;
&amp;gt; mulivariables). I changed my mfile and tried to do it. Here is what I have &lt;br&gt;
&amp;gt; been up to:&lt;br&gt;
&amp;gt; First here is my new modified mfile:&lt;br&gt;
&amp;gt; %Attempting to set up multivariable Fixed-Point Iteration&lt;br&gt;
&amp;gt; %Computes approximate solution of g(x)=x&lt;br&gt;
&amp;gt; %Input: inline function g, starting guess x0,&lt;br&gt;
&amp;gt; %       number of steps k&lt;br&gt;
&amp;gt; %Output: Approximate solution xc&lt;br&gt;
&amp;gt; function xc=fpi(g,x0,y0,k)&lt;br&gt;
&amp;gt; x(1)=(x0,y0);&lt;br&gt;
&amp;gt; for i=1:k&lt;br&gt;
&amp;gt;  x(i+1)=g(x(i),y(i));&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; x'                 %transpose output to a column&lt;br&gt;
&amp;gt; xc=x(k+1);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;#8230; and here is me calling the function and the MATLAB response&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; clear&lt;br&gt;
&amp;gt; x=-10:.001:10;&lt;br&gt;
&amp;gt; y=-10:.001:10;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; x=fpixy(inline('((x.^2+y.^2+8)/10)'),.5,.5,2)&lt;br&gt;
&amp;gt; ??? Error: File: fpixy.m Line: 7 Column: 9&lt;br&gt;
&amp;gt; Expression or statement is incorrect--possibly unbalanced (, {, or [.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I am pretty sure that it is not unbalaced, but something must be wrong &lt;br&gt;
&amp;gt; with line 7 of my mfile, which is:  x(1)=(x0,y0);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Can I even do a multivariable FPI?&lt;br&gt;
&amp;gt; I hope I described my situation clearly. Thanks for any help. </description>
    </item>
    <item>
      <pubDate>Thu, 02 Jul 2009 20:37:01 -0400</pubDate>
      <title>Re: Fixed point Iteration (multivariable) 2</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255197#662369</link>
      <author>Sean Douglas</author>
      <description>Thank you very much for response - just giving me new ideas helps alot. &lt;br&gt;
&lt;br&gt;
square brackets[] will turn it into a matrix, I dont know if I want that even though the output get transposed at the end of the mfile.&lt;br&gt;
&lt;br&gt;
BTW I did not need to use square brackets when I did the single variable problem that i put as an example in my previous question.&lt;br&gt;
I dont know yet though,  you may be on to something &lt;br&gt;
&lt;br&gt;
thanks Steve&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Steve Conahan&quot; &amp;lt;sconahan@mathworks.com&amp;gt; wrote in message &amp;lt;h2j3hu$mq4$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi Sean,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; ??? Error: File: fpixy.m Line: 7 Column: 9&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; As indicated, Line: 7 needs some re-writing:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   x(1)=(x0,y0);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I am not exactly sure what you are trying to do, but I suspect that the &lt;br&gt;
&amp;gt; right hand side of the above equation is not written correctly...perhaps you &lt;br&gt;
&amp;gt; need square braces [ instead of parentheses ( on the right hand side...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; hth,&lt;br&gt;
&amp;gt; Steve&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Sean Douglas&quot; &amp;lt;seanjdouglas@hotmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; news:h2ipv9$h8m$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; &amp;gt; Hello I am trying to perform fixed point iteration on this problem:&lt;br&gt;
&amp;gt; &amp;gt; x1=g1(x1,x2)=(x1^2+x2^2+8)/10,   x2=g2(x1,x2)=(x1*x2^2+x1+8)/10&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; first I made it one variable since I am x1 and x2 will be equal to each &lt;br&gt;
&amp;gt; &amp;gt; other anyways.                  Here is my mfile:&lt;br&gt;
&amp;gt; &amp;gt; %Computes approximate solution of g(x)=x&lt;br&gt;
&amp;gt; &amp;gt; %Input: inline function g, starting guess x0,&lt;br&gt;
&amp;gt; &amp;gt; %       number of steps k&lt;br&gt;
&amp;gt; &amp;gt; %Output: Approximate solution xc&lt;br&gt;
&amp;gt; &amp;gt; function xc=fpi(g,x0,k)&lt;br&gt;
&amp;gt; &amp;gt; x(1)=x0;&lt;br&gt;
&amp;gt; &amp;gt; for i=1:k&lt;br&gt;
&amp;gt; &amp;gt;  x(i+1)=g(x(i));&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; x'                 %transpose output to a column&lt;br&gt;
&amp;gt; &amp;gt; xc=x(k+1);&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; then I defined x and did the inline function:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; clear&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; x=-10:.001:10;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; x=fpi(inline('((x.^2+x.^2+8)/10)'),.5,2)&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; ans =&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;    0.5000&lt;br&gt;
&amp;gt; &amp;gt;    0.8500&lt;br&gt;
&amp;gt; &amp;gt;    0.9445&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; x =&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; 0.9445 this worked nicely&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Now I am trying to do this how the question was set up (with &lt;br&gt;
&amp;gt; &amp;gt; mulivariables). I changed my mfile and tried to do it. Here is what I have &lt;br&gt;
&amp;gt; &amp;gt; been up to:&lt;br&gt;
&amp;gt; &amp;gt; First here is my new modified mfile:&lt;br&gt;
&amp;gt; &amp;gt; %Attempting to set up multivariable Fixed-Point Iteration&lt;br&gt;
&amp;gt; &amp;gt; %Computes approximate solution of g(x)=x&lt;br&gt;
&amp;gt; &amp;gt; %Input: inline function g, starting guess x0,&lt;br&gt;
&amp;gt; &amp;gt; %       number of steps k&lt;br&gt;
&amp;gt; &amp;gt; %Output: Approximate solution xc&lt;br&gt;
&amp;gt; &amp;gt; function xc=fpi(g,x0,y0,k)&lt;br&gt;
&amp;gt; &amp;gt; x(1)=(x0,y0);&lt;br&gt;
&amp;gt; &amp;gt; for i=1:k&lt;br&gt;
&amp;gt; &amp;gt;  x(i+1)=g(x(i),y(i));&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; x'                 %transpose output to a column&lt;br&gt;
&amp;gt; &amp;gt; xc=x(k+1);&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;#8230; and here is me calling the function and the MATLAB response&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; clear&lt;br&gt;
&amp;gt; &amp;gt; x=-10:.001:10;&lt;br&gt;
&amp;gt; &amp;gt; y=-10:.001:10;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; x=fpixy(inline('((x.^2+y.^2+8)/10)'),.5,.5,2)&lt;br&gt;
&amp;gt; &amp;gt; ??? Error: File: fpixy.m Line: 7 Column: 9&lt;br&gt;
&amp;gt; &amp;gt; Expression or statement is incorrect--possibly unbalanced (, {, or [.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I am pretty sure that it is not unbalaced, but something must be wrong &lt;br&gt;
&amp;gt; &amp;gt; with line 7 of my mfile, which is:  x(1)=(x0,y0);&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Can I even do a multivariable FPI?&lt;br&gt;
&amp;gt; &amp;gt; I hope I described my situation clearly. Thanks for any help. &lt;br&gt;
&amp;gt; </description>
    </item>
  </channel>
</rss>

