edit
I
??? Undefined function or variable 'I'.
A=rand(4);
[L,U]=lu(A);
L
L =
0.8920 -0.3250 1.0000 0
0.9917 1.0000 0 0
0.1390 -0.4552 0.2567 1.0000
1.0000 0 0 0
L*U
ans =
0.8147 0.6324 0.9575 0.9572
0.9058 0.0975 0.9649 0.4854
0.1270 0.2785 0.1576 0.8003
0.9134 0.5469 0.9706 0.1419
A
A =
0.8147 0.6324 0.9575 0.9572
0.9058 0.0975 0.9649 0.4854
0.1270 0.2785 0.1576 0.8003
0.9134 0.5469 0.9706 0.1419
[L,U,P]=lu(A);
L
L =
1.0000 0 0 0
0.9917 1.0000 0 0
0.8920 -0.3250 1.0000 0
0.1390 -0.4552 0.2567 1.0000
U
U =
0.9134 0.5469 0.9706 0.1419
0 -0.4448 0.0024 0.3447
0 0 0.0925 0.9426
0 0 0 0.6955
L*U
ans =
0.9134 0.5469 0.9706 0.1419
0.9058 0.0975 0.9649 0.4854
0.8147 0.6324 0.9575 0.9572
0.1270 0.2785 0.1576 0.8003
P*A
ans =
0.9134 0.5469 0.9706 0.1419
0.9058 0.0975 0.9649 0.4854
0.8147 0.6324 0.9575 0.9572
0.1270 0.2785 0.1576 0.8003
% A*x=b
% L*U = P*A
% P*A*x=P*b
% L*U*x=P*b
% U*x=y
% L*y=P*b
A=toeplitz([-2,1,0,0,0]);
b=ones(5,1);
y0=[1,2,3,4,5]';
y=thetametodolin(A,b,y0,1,1/2,10);
y
y =
Columns 1 through 4
1.0000 1.0954 1.1826 1.2627
2.0000 2.0997 2.1984 2.2951
3.0000 3.0988 3.1936 3.2818
4.0000 4.0749 4.1079 4.1132
5.0000 4.5489 4.1846 3.8884
Columns 5 through 8
1.3369 1.4060 1.4706 1.5310
2.3889 2.4791 2.5653 2.6470
3.3623 3.4349 3.4999 3.5579
4.1007 4.0774 4.0478 4.0154
3.6457 3.4455 3.2793 3.1405
Columns 9 through 11
1.5877 1.6409 1.6908
2.7242 2.7968 2.8648
3.6096 3.6557 3.6970
3.9822 3.9497 3.9189
3.0239 2.9255 2.8422
y=thetametodolin(A,b,y0,1,1/2,20);
y(:,21)
ans =
1.6907
2.8648
3.6966
3.9187
2.8436
y=thetametodolin(A,b,y0,1,1/2,40);
y(:,41)
ans =
1.6907
2.8647
3.6965
3.9186
2.8440
y=thetametodolin(A,b,y0,1,1,40);
y(:,41)
ans =
1.6868
2.8593
3.6913
3.9211
2.8595
y=thetametodolin(A,b,y0,1,1,160);
y(:,161)
ans =
1.6897
2.8633
3.6951
3.9192
2.8480
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
ans =
3.1172e-05
ans =
4.8464e-11
ans =
5.5373e-17
ans =
3.0786e-05
ans =
4.7155e-11
ans =
3.7975e-17
ans =
3.0106e-05
ans =
4.4983e-11
ans =
1.3775e-17
ans =
2.9154e-05
ans =
4.2081e-11
ans =
3.4356e-17
ans =
2.7961e-05
ans =
3.8618e-11
ans =
1.0282e-17
ans =
2.6565e-05
ans =
3.4779e-11
ans =
3.0777e-17
ans =
2.5008e-05
ans =
3.0753e-11
ans =
2.3885e-17
??? Operation terminated by user during ==>
logistica at 25
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
ans =
3.1198e-05
ans =
2.5907e-08
ans =
2.1526e-11
ans =
1.7834e-14
??? Operation terminated by user during ==>
logistica at 25
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
logistica
diary off