Kelvin's Octave Assignment: Difference between revisions

From Class Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
==Solve Linear System of EQ's with Octave==
==Solve Linear System of EQ's with Octave==


x = A\b solves the equation ''A'''''x'''='''b'''
This will solve and print solutions for the equations:

For example, this will solve and print solutions for the equations:


'''<math>1 \times x1+2 \times x2+3 \times x3=55</math>'''
'''<math>1 \times x1+2 \times x2+3 \times x3=55</math>'''

Latest revision as of 20:45, 3 October 2010

Solve Linear System of EQ's with Octave

x = A\b solves the equation Ax=b

For example, this will solve and print solutions for the equations:


clear all
close all
A=[1,2,3
   4,5,6
   7,8,9];
b=[55
   20
   42];
result = A\b;
x1=result(1)
x2=result(2)
x3=result(3)