Differences between revisions 3 and 4

Deletions are marked like this. Additions are marked like this.
Line 24: Line 24:
x = Trsv_ln_unb_var1( b, L , x); x = Trsv_ln_unb_var1( b, L );

% Set matrix dimension
n = 5;

% Create a random matrix for L 
L = rand( n, n );

% Make sure that L is lower triangular
L = tril(L);

% Make sure that L is nonsingular
L = L + n * eye(n, n);
disp("L = "), disp(L);

% create a random vector b
b = rand(n, 1);
disp("b = "), disp(b);

%initialize a vector x
x = zeros(n, 1);

% Compute the solution
x = Trsv_ln_unb_var1( b, L );

%display the solution
disp("solution: x = "), disp(x);


LinearAlgebraWiki: Trsv ln/FLAME@lab/DriverUnbVar1 (last edited 2008-08-06 19:55:07 by MarthaGanser)