Professional Documents
Culture Documents
A =
-3 6 -4
9 -8 24
-12 24 -26
B=[-3;65;42]
B =
-3
65
42
[L,U,E]= lu(A)
L =
1.0000 0 0
-0.7500 1.0000 0
0.2500 0 1.0000
U =
E =
0 0 1
0 1 0
1 0 0
Z=L\B
Z =
-3.0000
62.7500
42.7500
XX=A\B
XX =
32.3600
12.0800
-5.4000
X=U\Z
X =
-39.6400
-1.4200
17.1000
A = [1 1 1 ; 2 4 4 ; 1 2 3]
A =
1 1 1
2 4 4
1 2 3
b = [1 3 3]
b =
1 3 3
B=b'
B =
1
3
3
X0=[0;0;0]
X0 =
0
0
0
jacobi (A,B,X0,0.000001,50)
ans =
1.0e+007 *
-1.2044
-0.9540
-0.7384
uiopen('C:\Users\Excalibur\Documents\MATLAB\gaussjordan.m',1)
uiopen('C:\Users\Excalibur\Documents\MATLAB\gaussseidel.m',1)
gaussseidel
{#??? Error using ==> mtimes
Inner matrix dimensions must agree.
A =
1 2 5 3
2 1 3 -5
-2 -1 5 1
3 3 -1 2
b = [-3 3 -2 3]
b =
-3 3 -2 3
B=b'
B =
-3
3
-2
3
uiopen('C:\Users\Excalibur\Documents\MATLAB\sor.m',1)
SOR (A,B,X0,0.001,1.75)
{#Warning: Could not find an exact (case-sensitive) match for 'SOR'.
C:\Users\Excalibur\Documents\MATLAB\sor.m is a case-insensitive match and will be
used
instead.
You can improve the performance of your code by using exact
name matches and we therefore recommend that you update your
usage accordingly. Alternatively, you can disable this warning using
warning('off','MATLAB:dispatcher:InexactCaseMatch').
This warning will become an error in future releases.}#
{#??? Error using ==> mtimes
Inner matrix dimensions must agree.
A =
6 2 1 -1
2 4 1 0
1 1 4 -1
-1 0 -1 3
B=[9;13;11;8]
B =
9
13
11
8
sor (A,B,X0,0.001,1)
{#??? Error using ==> mtimes
Inner matrix dimensions must agree.
A =
6 2 1 -1
2 4 1 0
1 1 4 -1
-1 0 -1 3
B=[9;13;11;8]
B =
9
13
11
8
X0=[0;0;0;0]
X0 =
0
0
0
0
sor (A,B,X0,0.000001,1)
Columns 1 through 8
Columns 9 through 13
ans =
1.0000
2.0000
3.0000
4.0000
A = [1 2 5 3 ; 2 1 3 -5 ; -2 -1 5 1 ; 3 3 -1 2]
A =
1 2 5 3
2 1 3 -5
-2 -1 5 1
3 3 -1 2
b = [-3 3 -2 3]
b =
-3 3 -2 3
B=b'
B =
-3
3
-2
3
sor (A,B,X0,0.001,1)
{#Warning: Rank deficient, rank = 0, tol = NaN.}#
> In <a href="matlab:
opentoline('C:\Users\Excalibur\Documents\MATLAB\sor.m',19,1)">sor at 19</a>
1.0e+307 *
Columns 1 through 8
Columns 9 through 16
Columns 17 through 24
Columns 25 through 32
Columns 33 through 40
Columns 41 through 48
Columns 49 through 56
Columns 57 through 64
Columns 65 through 72
Columns 73 through 80
Columns 81 through 88
ans =
NaN
NaN
NaN
NaN
sor (A,B,X0,0.001,1.75)
{#Warning: Rank deficient, rank = 0, tol = NaN.}#
> In <a href="matlab:
opentoline('C:\Users\Excalibur\Documents\MATLAB\sor.m',19,1)">sor at 19</a>
1.0e+308 *
Columns 1 through 8
Columns 9 through 16
Columns 17 through 24
Columns 25 through 32
Columns 33 through 40
Columns 41 through 48
Columns 49 through 56
Columns 57 through 64
Columns 65 through 72
Columns 73 through 80
Columns 81 through 88
0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000
-0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000
-0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000
0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000
Columns 89 through 96
ans =
NaN
NaN
NaN
NaN
sor (A,B,X0,0.001,1.9387)
{#Warning: Rank deficient, rank = 0, tol = 1.#INFe+000.}#
> In <a href="matlab:
opentoline('C:\Users\Excalibur\Documents\MATLAB\sor.m',19,1)">sor at 19</a>
1.0e+308 *
Columns 1 through 8
Columns 9 through 16
Columns 17 through 24
Columns 25 through 32
Columns 33 through 40
Columns 41 through 48
Columns 49 through 56
Columns 57 through 64
Columns 65 through 72
Columns 73 through 80
Columns 81 through 88
Columns 89 through 96
ans =
1.0e+308 *
0.2386
-1.7725
-0.4805
Inf
uiopen('C:\Users\Excalibur\Documents\MATLAB\sor.m',1)
uiopen('C:\Users\Excalibur\Documents\MATLAB\sor.m',1)
uiopen('C:\Users\Excalibur\Documents\MATLAB\sor.m',1)
sor (A,B,X0,0.1,1.9387)
{#Warning: Rank deficient, rank = 0, tol = 1.#INFe+000.}#
> In <a href="matlab:
opentoline('C:\Users\Excalibur\Documents\MATLAB\sor.m',19,1)">sor at 19</a>
1.0e+308 *
Columns 1 through 8
Columns 9 through 16
Columns 17 through 24
Columns 25 through 32
Columns 33 through 40
Columns 41 through 48
Columns 49 through 56
Columns 57 through 64
Columns 73 through 80
Columns 81 through 88
Columns 89 through 96
ans =
1.0e+308 *
0.2386
-1.7725
-0.4805
Inf
uiopen('C:\Users\Excalibur\Documents\MATLAB\sor.m',1)
opentoline('C:\Users\Excalibur\Documents\MATLAB\sor.m',19,1)
uiopen('C:\Users\Excalibur\Documents\MATLAB\sor.m',1)
uiopen('C:\Users\Excalibur\Documents\MATLAB\sor.m',1)
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
sor
{#??? Input argument "A" is undefined.