File: BasicTasksS09.htm

package info (click to toggle)
extrema 4.4.4.dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 19,416 kB
  • ctags: 6,689
  • sloc: cpp: 88,991; sh: 8,229; makefile: 480
file content (30 lines) | stat: -rw-r--r-- 782 bytes parent folder | download | duplicates (2)
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="BasicTasksS08.htm"><img src="../shadow_left.gif">&nbsp;
    <font size="+1" color="olive">Integrate a function</font></a><br />
  <a href="BasicTasksS10.htm"><img src="../shadow_right.gif">&nbsp;
    <font size="+1" color="olive">Read data from files</font></a>
</P>
</BODY>
</HTML>