[CSC 335] Octave and Row Operations

Andrew J. Pounds pounds_aj at mercer.edu
Thu Nov 7 10:38:16 EST 2013


I promised to send along some help on how to do row operations
in Octave.  Fortunately this has been a problem that many folks have tackled
before, so let me ask you to start by downloading three Octave functions
written by Dr. Doug Rall at Furman.


elemrow1.m  <http://math.furman.edu/%7Edrall/mth160-2013-F/elemrow1.m>
elemrow2.m  <http://math.furman.edu/%7Edrall/mth160-2013-F/elemrow2.m>  
elemrow3.m  <http://math.furman.edu/%7Edrall/mth160-2013-F/elemrow3.m>  

Save these in the directory where you will run Octave.  To see how to
use them type "help elemrow1" in Octave.  Below I will use the third
operation to row reduce the linear system via Gaussian Elimination (the
example I worked in class yesterday)

octave:2> A = [2,1,3,1;4,4,7,1;2,5,9,3]
A =

     2   1   3   1
     4   4   7   1
     2   5   9   3

octave:3> A = elemrow3(A,1,2,-2)
A =

     2   1   3   1
     0   2   1  -1
     2   5   9   3

octave:4> A = elemrow3(A,1,3,-1)
A =

     2   1   3   1
     0   2   1  -1
     0   4   6   2

octave:5> A = elemrow3(A,2,3,-2)
A =

     2   1   3   1
     0   2   1  -1
     0   0   4   4

-- 
Andrew J. Pounds, Ph.D.  (pounds_aj at mercer.edu)
Professor of Chemistry and Computer Science
Mercer University,  Macon, GA 31207   (478) 301-5627
http://faculty.mercer.edu/pounds_aj

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc335/attachments/20131107/5de30df7/attachment.html>


More information about the csc335 mailing list