ÿþA d a m S z u s t a l e w i c z M a t e m a t y k a o b l i c z e n i o w a 2 0 0 2 / 2 0 0 3 w . 1 0 1 6 . 1 2 . 0 2
W y k Ba d 1 0 : M e t o d y n u m e r y c z n e : M e t o d a e l i m i n a c j i G a u s s a
1 . T e r m i n y e g z a m i n u :
1 . K o l o k w i u m : ?
2 . E g z a m i n :
1 . ?
2 . ?
3 . ( p o p r . ) ?
2 . O b l i c z a n i e w a r t o [c i w y z n a c z n i k a
( p r o s z e o b e j r z e i z a s t a n o w i s i e n a d t r e [c i a m i f u n k c j i , s k r y p t ó w , . . . n a d e s Ba n y c h p r z e z s t u -
d e n t ó w )
" K a t a r z y n a Z i m a :
% p r o g r a m n a l i c z e n i e w y z n a c z n i k a p r z e z d o p r o w a d z e n i e m a c i e r z y d o m a c i e r z y t r ó j k at n e j
f u n c t i o n r = w y z n ( A )
[ n , m ] = s i z e ( A )
k = 2 ;
i f n ~ = m
r = n ~ = m ; b r e a k
e n d
i f n = = 1
r = A ( 1 , 1 ) ;
e l s e
f o r j = 1 : ( m - 1 )
f o r i = k : n
A ( i , : ) = A ( i , : ) - A ( j , : ) * A ( i , j ) / A ( j , j ) ;
e n d
k = k + 1 ;
e n d
s = 1 ;
f o r i = 1 : n
s = s * A ( i , i ) ;
e n d
r = s
e n d
" M a r t a S t ó j :
c l c , c l e a r , c l o s e a l l
% O b l i c z a n i e w y z n a c z n i k a z a p o m o c a m e t o d y e l i m i n a c j i
% " A " j e s t t o m a c i e r z d i a g o n a l n a
% " w " j e s t w a r t o s c i a w y z n a c z n i k a
f p r i n t f ( P o d a j m a c i e r z A w p o d a n e j p o n i z e j p o s t a c i \ n ) ;
f p r i n t f ( [ a 1 1 , . . . , a 1 n ; . . . ; a n 1 , . . . , a n n ] \ n ) ;
A = i n p u t ( A = ) ;
n = l e n g t h ( A ) ;
f o r i = 2 : n
j = 1 ;
w h i l e j <