<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262837</link>
    <title>MATLAB Central Newsreader - underdetermined linear equation system</title>
    <description>Feed for thread: underdetermined linear equation system</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>Sun, 11 Oct 2009 15:38:19 -0400</pubDate>
      <title>underdetermined linear equation system</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262837#686241</link>
      <author>arnold szilagyi</author>
      <description>hello,&lt;br&gt;
&lt;br&gt;
I have a big an very urgent problem. I have to solve an equation system in this way:&lt;br&gt;
&lt;br&gt;
I have 50 unknows, and 8-15 equations. I have an initiative solution, so I'm looking for an iterative method to solve the system.&lt;br&gt;
&lt;br&gt;
Since I'm not a mathematician, I googled a lot for an appropiate method, but I couldn't find nothing. &lt;br&gt;
I tried the mldivide function of the matlab, but it is not good for me. the solutions must be all positive, and matlab gives me a lot of zeros (I know that's the way it solves the system with mldivide).&lt;br&gt;
&lt;br&gt;
So I'm stuck.&lt;br&gt;
can anybody help me please?&lt;br&gt;
&lt;br&gt;
bets regards&lt;br&gt;
arnold</description>
    </item>
    <item>
      <pubDate>Sun, 11 Oct 2009 15:59:03 -0400</pubDate>
      <title>Re: underdetermined linear equation system</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262837#686246</link>
      <author>Bruno Luong</author>
      <description>&quot;arnold szilagyi&quot; &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote in message &amp;lt;hasu5b$di4$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; hello,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have a big an very urgent problem. I have to solve an equation system in this way:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have 50 unknows, and 8-15 equations. I have an initiative solution, so I'm looking for an iterative method to solve the system.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Since I'm not a mathematician, I googled a lot for an appropiate method, but I couldn't find nothing. &lt;br&gt;
&amp;gt; I tried the mldivide function of the matlab, but it is not good for me. the solutions must be all positive, and matlab gives me a lot of zeros (I know that's the way it solves the system with mldivide).&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
What you must specify how you want your solution to be, among the infinity number of solutions of&lt;br&gt;
&lt;br&gt;
A*x = b % A is (8 x 50) matrix&lt;br&gt;
&lt;br&gt;
For example, if you tell&lt;br&gt;
|x| is minimal, % where |x| is sqrt(sum(x.^2))&lt;br&gt;
&lt;br&gt;
then the solution is&lt;br&gt;
x = pinv(A)*b&lt;br&gt;
&lt;br&gt;
If you want solution to be all positive, then you need to add&lt;br&gt;
&lt;br&gt;
A*x = b&lt;br&gt;
x &amp;gt;= epsilon&lt;br&gt;
&lt;br&gt;
where epsilon is a small positive number. The positive constraints alone are *not* enough solve the system. You might want &lt;br&gt;
&lt;br&gt;
min J(x) := |x|^2 such that&lt;br&gt;
A*x = b&lt;br&gt;
x &amp;gt;= epsilon&lt;br&gt;
&lt;br&gt;
This is quadratic programming. If you have optilmization toolbox, the function QUADPROG will do that for you.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Sun, 11 Oct 2009 16:24:02 -0400</pubDate>
      <title>Re: underdetermined linear equation system</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262837#686251</link>
      <author>Bruno Luong</author>
      <description>To complement my previous posts, the two other popular constraints are:&lt;br&gt;
&lt;br&gt;
(P1)&lt;br&gt;
min L1(x) := sum |x(i)|&lt;br&gt;
A*x = b&lt;br&gt;
x &amp;gt;= epsilon&lt;br&gt;
&lt;br&gt;
(P2)&lt;br&gt;
min Linf(x) := max{|x(i)|}&lt;br&gt;
A*x = b&lt;br&gt;
x &amp;gt;= epsilon&lt;br&gt;
&lt;br&gt;
Both problems (P1) and (P2) can be solved with &quot;linear programming&quot; using LINPROG (also in optimization toolbox).&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Sun, 11 Oct 2009 17:02:06 -0400</pubDate>
      <title>Re: underdetermined linear equation system</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262837#686257</link>
      <author>John D'Errico</author>
      <description>&quot;arnold szilagyi&quot; &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote in message &amp;lt;hasu5b$di4$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; hello,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have a big an very urgent problem. I have to solve an equation system in this way:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have 50 unknows, and 8-15 equations. I have an initiative solution, so I'm looking for an iterative method to solve the system.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Since I'm not a mathematician, I googled a lot for an appropiate method, but I couldn't find nothing. &lt;br&gt;
&amp;gt; I tried the mldivide function of the matlab, but it is not good for me. the solutions must be all positive, and matlab gives me a lot of zeros (I know that's the way it solves the system with mldivide).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; So I'm stuck.&lt;br&gt;
&amp;gt; can anybody help me please?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; bets regards&lt;br&gt;
&amp;gt; arnold&lt;br&gt;
&lt;br&gt;
There are infinitely many solutions to your problem.&lt;br&gt;
So MATLAB chooses an arbitrary one. If you have&lt;br&gt;
additional information (i.e., that the solution must&lt;br&gt;
be non-negative) then you must supply that piece&lt;br&gt;
of information!&lt;br&gt;
&lt;br&gt;
Use a tool that will allow you to do this. One such&lt;br&gt;
tool is linprog. A second is lsqnonneg. I'd expect to&lt;br&gt;
see different solutions from the two, but since there&lt;br&gt;
are infinitely many solutions, what else can you&lt;br&gt;
expect?&lt;br&gt;
&lt;br&gt;
Note that if you use linprog, you will need to provide&lt;br&gt;
a linear objective function.&lt;br&gt;
&lt;br&gt;
John</description>
    </item>
    <item>
      <pubDate>Sun, 11 Oct 2009 19:05:05 -0400</pubDate>
      <title>Re: underdetermined linear equation system</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262837#686270</link>
      <author>arnold szilagyi</author>
      <description>thank you for your quick and precious reply.&lt;br&gt;
&lt;br&gt;
first of all I tried the quadprog function with the min J(x) := |x|^2 cost function.&lt;br&gt;
but all that matlab gives to me is zeros. &lt;br&gt;
here is the code that doesn't work for me (maybe I'm missing something):&lt;br&gt;
&lt;br&gt;
A=[0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0;0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1;1 0 0 1 1 1 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0;0 0 1 0 0 0 1 1 1 1 0 1 0 0 0 1 0 0 0 0 1 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 0;1 1 1 1 0 1 1 1 0 0 1 1 1 1 1 0 0 0 1 1 0 0 0 1 0 1 1 0 1 1 1 1 1 1 1 1 0 0 0 1 0 0 1 0 0 1 1 1 0 0;0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 1 1 1 0 0 1 1 1 0 1 0 0 1 0 0 0 0 0 0 0 0 1 1 1 0 1 1 0 1 1 0 0 0 1 1;0 0 1 0 1 1 1 0 0 0 0 1 0 1 1 1 1 0 1 1 1 0 1 1 0 1 0 1 1 1 0 0 1 1 0 1 1 0 1 0 0 1 0 0 0 1 0 1 1 0;1 1 0 1 0 0 0 1 1 1 1 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 0 1 1 0 0 1 0 0 1 0 1 1 0 1 1 1 0 1 0 0 1;1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 0 &lt;br&gt;
0;0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1;0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 1 1 1 0 1 0 1 1 0 0 1 0 1 0 0 1 1 0 1 0;0 0 0 0 0 0 1 0 1 1 1 0 0 1 0 1 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 1 1 0 1 0 1 1 1 0 0 0 0 0 1 0;1 1 0 1 1 0 0 1 0 0 0 1 1 0 1 0 0 1 1 0 0 1 0 0 1 1 1 1 0 0 1 1 1 1 1 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1;0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0]; &lt;br&gt;
&lt;br&gt;
B=[312;351;396;506;930;580;891;621;585;360;84;575;496;756;288];&lt;br&gt;
&lt;br&gt;
n=51;&lt;br&gt;
H=toeplitz([1 zeros(1,n-2)],[1 zeros(1,n-2)]);&lt;br&gt;
&lt;br&gt;
f=zeros(50,1);&lt;br&gt;
&lt;br&gt;
lb=zeros(50,1);&lt;br&gt;
&lt;br&gt;
ub=ones(3,1);&lt;br&gt;
ub=ub*100;&lt;br&gt;
&lt;br&gt;
[x,fval,exitflag,output,lambda] = quadprog(H,f,A,B,[],[],lb,ub)&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
this is the situation: I look for 50 numbers which's average satisfies some constraints.&lt;br&gt;
for example:&lt;br&gt;
(a1+a2+a4)/3=20&lt;br&gt;
(a1+a3)/2=60&lt;br&gt;
&lt;br&gt;
so I made the A matrix corresponding to the groups of numbers and I made B in this way (adapted to my little example):&lt;br&gt;
&lt;br&gt;
A=[1 1 0 1; 1 0 1 0];&lt;br&gt;
B=[20*3; 60*2];&lt;br&gt;
&lt;br&gt;
I made a diagonal matrix for H with the values of 1 on the diagonal, and put 0 to the f, because I just use the x^2 in the cost function.&lt;br&gt;
I added lower and upper limits and called the function.&lt;br&gt;
the answer is 50 zero.&lt;br&gt;
I don't know what am I missing.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
after this I tried the linprog function&lt;br&gt;
every matrix is the same and I call&lt;br&gt;
&lt;br&gt;
[x,fval,exitflag,output,lambda] = linprog(f,A,B,[],[],lb,ub)&lt;br&gt;
&lt;br&gt;
now it gives me nice numbers as a solution. but they don't satisfy the average conditions. &lt;br&gt;
Maybe made a mistake to give to F zeros. but I don't know what should I try.&lt;br&gt;
&lt;br&gt;
any suggestions?&lt;br&gt;
&lt;br&gt;
regards&lt;br&gt;
arnold</description>
    </item>
    <item>
      <pubDate>Sun, 11 Oct 2009 19:20:22 -0400</pubDate>
      <title>Re: underdetermined linear equation system</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262837#686273</link>
      <author>Bruno Luong</author>
      <description>&quot;arnold szilagyi&quot; &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote in message &amp;lt;hata91$ra1$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
maybe I'm missing something&lt;br&gt;
&lt;br&gt;
&amp;gt; [x,fval,exitflag,output,lamda] = quadprog(H,f,A,B,[],[],lb,ub)&lt;br&gt;
&amp;nbsp;&lt;br&gt;
Yes READ careful the doc of quadprog/linprog, you mess inputs between inequalities and equality constraints.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Sun, 11 Oct 2009 19:54:04 -0400</pubDate>
      <title>Re: underdetermined linear equation system</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262837#686278</link>
      <author>arnold szilagyi</author>
      <description>&lt;br&gt;
&amp;gt; Yes READ careful the doc of quadprog/linprog, you mess inputs between inequalities and equality constraints.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Bruno&lt;br&gt;
&lt;br&gt;
quote:&lt;br&gt;
&quot;x = quadprog(H,f,A,b,Aeq,beq) solves the problem above while additionally satisfying the equality constraints Aeq*x = beq.&quot;&lt;br&gt;
&lt;br&gt;
this means that my A and B matrices are actually Aeq an beq???&lt;br&gt;
&lt;br&gt;
if so what is the right syntax, because I can not figure it out.&lt;br&gt;
&lt;br&gt;
arnold</description>
    </item>
    <item>
      <pubDate>Sun, 11 Oct 2009 22:38:03 -0400</pubDate>
      <title>Re: underdetermined linear equation system</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262837#686294</link>
      <author>Bruno Luong</author>
      <description>&amp;gt; &lt;br&gt;
&amp;gt; this means that my A and B matrices are actually Aeq an beq???&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; if so what is the right syntax, because I can not figure it out.&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Read even *more* carefully the doc.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Mon, 12 Oct 2009 10:53:04 -0400</pubDate>
      <title>Re: underdetermined linear equation system</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262837#686384</link>
      <author>arnold szilagyi</author>
      <description>&quot;Bruno Luong&quot; &amp;lt;b.luong@fogale.findmycountry&amp;gt; wrote in message &amp;lt;hatmob$rm9$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; this means that my A and B matrices are actually Aeq an beq???&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; if so what is the right syntax, because I can not figure it out.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Read even *more* carefully the doc.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Bruno&lt;br&gt;
&lt;br&gt;
I'm sorry but I obviously miss something.&lt;br&gt;
I read a lot of times the doc, and I made the following conclusion:&lt;br&gt;
&lt;br&gt;
I have to use in this way:&lt;br&gt;
[x,fval,exitflag,output,lamda] = quadprog(H,f,[],[],A,B,lb,ub)&lt;br&gt;
&lt;br&gt;
but I tried and it gives me zeros.&lt;br&gt;
&lt;br&gt;
Please help me.&lt;br&gt;
&lt;br&gt;
regards&lt;br&gt;
arnold</description>
    </item>
    <item>
      <pubDate>Mon, 12 Oct 2009 11:16:04 -0400</pubDate>
      <title>Re: underdetermined linear equation system</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262837#686388</link>
      <author>Johan L?fberg</author>
      <description>The model you have defined is infeasible, ie. not underdetermined but overdetermined and thus infeasible in quadprog &lt;br&gt;
&lt;br&gt;
&amp;nbsp;output.message&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
The equality constraints are dependent.&lt;br&gt;
The system of equality constraints is not consistent.&lt;br&gt;
The inequality constraints may or may not be satisfied.&lt;br&gt;
There is no feasible solution.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Just try to solve the linear systems and you'll see it directly&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; x = A\B;&lt;br&gt;
&amp;gt;&amp;gt; A*x-B&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;-7.3750&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;-7.3750&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;-7.3750&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;-7.3750&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;12.7500&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;12.7500&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;11.7500&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;11.7500&lt;br&gt;
&amp;nbsp;&amp;nbsp;-17.1250&lt;br&gt;
&amp;nbsp;&amp;nbsp;-17.1250&lt;br&gt;
&amp;nbsp;&amp;nbsp;-17.1250&lt;br&gt;
&amp;nbsp;&amp;nbsp;-17.1250&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;-0.0000&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;-0.0000&lt;br&gt;
&lt;br&gt;
&quot;arnold szilagyi&quot; &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote in message &amp;lt;hav1qg$mh7$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Bruno Luong&quot; &amp;lt;b.luong@fogale.findmycountry&amp;gt; wrote in message &amp;lt;hatmob$rm9$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; this means that my A and B matrices are actually Aeq an beq???&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; if so what is the right syntax, because I can not figure it out.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Read even *more* carefully the doc.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Bruno&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I'm sorry but I obviously miss something.&lt;br&gt;
&amp;gt; I read a lot of times the doc, and I made the following conclusion:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have to use in this way:&lt;br&gt;
&amp;gt; [x,fval,exitflag,output,lamda] = quadprog(H,f,[],[],A,B,lb,ub)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; but I tried and it gives me zeros.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Please help me.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; regards&lt;br&gt;
&amp;gt; arnold</description>
    </item>
    <item>
      <pubDate>Mon, 12 Oct 2009 11:54:04 -0400</pubDate>
      <title>Re: underdetermined linear equation system</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262837#686398</link>
      <author>Bruno Luong</author>
      <description>&quot;arnold szilagyi&quot; &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote in message &amp;lt;hav1qg$mh7$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; but I tried and it gives me zeros.&lt;br&gt;
&lt;br&gt;
Your A matrix is rank 12 and B is not in Image A. So there is never a x such that A*x=B. Garbage in garbage out.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Mon, 12 Oct 2009 17:34:20 -0400</pubDate>
      <title>Re: underdetermined linear equation system</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262837#686522</link>
      <author>arnold szilagyi</author>
      <description>&quot;Bruno Luong&quot; &amp;lt;b.luong@fogale.findmycountry&amp;gt; wrote in message &amp;lt;hav5cs$beq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;arnold szilagyi&quot; &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote in message &amp;lt;hav1qg$mh7$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; but I tried and it gives me zeros.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Your A matrix is rank 12 and B is not in Image A. So there is never a x such that A*x=B. Garbage in garbage out.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Bruno&lt;br&gt;
&lt;br&gt;
can you explain me this this, please?&lt;br&gt;
&lt;br&gt;
I can not work it out, even if I reduce the rank of A?&lt;br&gt;
&lt;br&gt;
thank you&lt;br&gt;
arnold</description>
    </item>
    <item>
      <pubDate>Mon, 12 Oct 2009 18:32:03 -0400</pubDate>
      <title>Re: underdetermined linear equation system</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/262837#686532</link>
      <author>Bruno Luong</author>
      <description>&quot;arnold szilagyi&quot; &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote in message &amp;lt;havpas$8c2$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Bruno Luong&quot; &amp;lt;b.luong@fogale.findmycountry&amp;gt; wrote in message &amp;lt;hav5cs$beq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &quot;arnold szilagyi&quot; &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote in message &amp;lt;hav1qg$mh7$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; but I tried and it gives me zeros.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Your A matrix is rank 12 and B is not in Image A. So there is never a x such that A*x=B. Garbage in garbage out.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Bruno&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; can you explain me this this, please?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I can not work it out, even if I reduce the rank of A?&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Your case is similar to this simple example:&lt;br&gt;
A=[0 0 0;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1 0 0]&lt;br&gt;
B=[1; 2];&lt;br&gt;
&lt;br&gt;
In this example rank(A) is 1. And span(A) = { A*x: x in R^3 } = { (0,a): a in R }. I let you check this statement.&lt;br&gt;
&lt;br&gt;
Since B(1)=1 in the above example, B is not in span(A) so there is no x such that A*x=B. Therefore when you feed the constraint A*x = B into QUADPROG and LINPROG, it cannot find any x. The &quot;feasible set&quot; is empty. Thus there is no solution (you should check the output flag, which is described in the doc) returned by QUADPROG.&lt;br&gt;
&lt;br&gt;
In short, your system is not only underdetermined, but it's also rank degenerated.&lt;br&gt;
&lt;br&gt;
Now back to *your* problem with 15 x 50 matrix size, do this to check the rank of A and alseo to see if you encountered similar problem:&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; rank(A)&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; B&lt;br&gt;
&lt;br&gt;
B =&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;312&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;351&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;396&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;506&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;930&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;580&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;891&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;621&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;585&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;360&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;84&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;575&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;496&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;756&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;288&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; BPrj=A*pinv(A)*B % Projection of B on span(A)&lt;br&gt;
&lt;br&gt;
BPrj =&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;304.6250&lt;br&gt;
&amp;nbsp;&amp;nbsp;343.6250&lt;br&gt;
&amp;nbsp;&amp;nbsp;388.6250&lt;br&gt;
&amp;nbsp;&amp;nbsp;498.6250&lt;br&gt;
&amp;nbsp;&amp;nbsp;942.7500&lt;br&gt;
&amp;nbsp;&amp;nbsp;592.7500&lt;br&gt;
&amp;nbsp;&amp;nbsp;902.7500&lt;br&gt;
&amp;nbsp;&amp;nbsp;632.7500&lt;br&gt;
&amp;nbsp;&amp;nbsp;567.8750&lt;br&gt;
&amp;nbsp;&amp;nbsp;342.8750&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;66.8750&lt;br&gt;
&amp;nbsp;&amp;nbsp;557.8750&lt;br&gt;
&amp;nbsp;&amp;nbsp;496.0000&lt;br&gt;
&amp;nbsp;&amp;nbsp;756.0000&lt;br&gt;
&amp;nbsp;&amp;nbsp;288.0000&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt;  Err = B-BPrj % Err is the projection of B on orthogonal(span(A))&lt;br&gt;
&lt;br&gt;
Err =&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7.3750&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7.3750&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7.3750&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7.3750&lt;br&gt;
&amp;nbsp;&amp;nbsp;-12.7500&lt;br&gt;
&amp;nbsp;&amp;nbsp;-12.7500&lt;br&gt;
&amp;nbsp;&amp;nbsp;-11.7500&lt;br&gt;
&amp;nbsp;&amp;nbsp;-11.7500&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;17.1250&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;17.1250&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;17.1250&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;17.1250&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0000&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0000&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0000&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; norm(Err)/norm(B) % &amp;lt;- should be close to 0 for B in span(A)&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0205&lt;br&gt;
&lt;br&gt;
% Bruno</description>
    </item>
  </channel>
</rss>

