Sfoglia il codice sorgente

Quelques modifications des fichiers Matlab

Sebastien Duminil 11 anni fa
parent
commit
2db5626ea6
5 ha cambiato i file con 13 aggiunte e 10 eliminazioni
  1. 1 1
      Matlab/CMRH.m
  2. 1 1
      Matlab/helsing.m
  3. 3 0
      Matlab/main.m
  4. 7 7
      Matlab/matrice.m
  5. 1 1
      Matlab/solution.m

+ 1 - 1
Matlab/CMRH.m

@@ -1,6 +1,6 @@
 function [x,tnorm,flag]=CMRH(A,b,tol,maxiter,x0,iprint)
 %
-% [x,tnorm,flag] = (A,b,tol,maxiter,x0,iprint)
+% function [x,tnorm,flag] = (A,b,tol,maxiter,x0,iprint)
 %
 % This function solves the linear system Ax=b using the CMRH method
 %

+ 1 - 1
Matlab/helsing.m

@@ -1,6 +1,6 @@
 function A = helsing(n)
 %
-% A = helsing(n)
+%function [A] = helsing(n)
 % 
 % This file creates a matrix A whose entries are defined by :
 % A(i,j)= -log|z(i)-z(j)| , if i .neq. j

+ 3 - 0
Matlab/main.m

@@ -1,5 +1,8 @@
 % main.m
 %
+%
+% May 2013
+%
 % This script allows to perform some numerical tests by giving the results
 % obtained when solving a linear system A*x=b by using the CMRH algorithm
 %

+ 7 - 7
Matlab/matrice.m

@@ -1,10 +1,10 @@
 function A=matrice(n,i_mat)
-%
-% A = matrice(n,i_mat)
-
+% 
+% function [A] = matrice(n,i_mat)
+% 
 % This function allows to choose the coefficient matrix of
 % the linear system A*x=b.  
-%
+% 
 % Input :   
 %           n       : the size of the coefficient matrix of 
 %                     the linear system A*x=b
@@ -16,11 +16,11 @@ function A=matrice(n,i_mat)
 % if i_mat = 3 then A(i,j) = abs(i-j)+1/(i-j) if (j < i  and j > i)
 %              and  A(i,j) = 0  if i=j   \n')
 % if i_mat = 4 then A(i,j)= i+j
-%
+% 
 % Output :  
 %           A       : the coefficient matrix of the linear system A*x=b
-%
-%
+% 
+% 
 if (i_mat==1)
     a=input('Enter alpha : ');
     b=input('Enter beta : ');

+ 1 - 1
Matlab/solution.m

@@ -1,6 +1,6 @@
 function [b,sol]=solution(A,i_rhs)
 %
-% [b,sol] = solution(A,i_rhs)
+% function [b,sol] = solution(A,i_rhs)
 %
 % This function allows to generate a right hand side b for
 % the linear system A*x=b so as that the exact solution is known.