File: solvematrix.htm

package info (click to toggle)
extrema 4.3.6-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 19,212 kB
  • ctags: 6,452
  • sloc: cpp: 86,428; sh: 8,229; makefile: 814
file content (30 lines) | stat: -rw-r--r-- 765 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<HTML>
<HEAD>
<TITLE>Solve a matrix equation</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">

<p>
 Solve <code>Ax=b</code> (and check the solution) given that</P>
<P>
 <pre>
       1  2  0       7
   A = 2  5 -1   b = 8
       4 10 -1       9
 </pre></P>
<P>
 <font color="blue"><pre>
 A=[[1;2;4];[2;5;10];[0;-1;-1]]
 b=[7;8;9]
 soln = gaussj(A,b)
 check = b-A&lt;&gt;soln</pre></font></P>
<P>
 The <code>check</code> vector should be all zero if the solution is correct.</P>
<P>
 <a href="integrate.htm"><img src="../shadow_left.gif">&nbsp;
 <font size="+1" color="olive">Integrate a function</font></a><br />
 <a href="readdata.htm"><img src="../shadow_right.gif">&nbsp;
 <font size="+1" color="olive">Read data from files</font></a>
</P>
</BODY>
</HTML>