MatLab for Gauss Elimination Method

Solved
magimax69 Posted messages 1 Status Member -  
 saida -
Hello,
indeed I am starting to work with Matlab, please I want a Matlab program for the Gauss method for solving Ax=b (using pivoting).
Thank you
Configuration: Windows XP Firefox 1.5.0.7

8 answers

  1. brahim.bms
     
    clear all
    close all
    a=[1 5 8;2 -4 10;6 2 -5]
    b=[5;1;3]
    A=[a b]
    n=size(A,1)
    for k=1:n-1
    for i=k+1:n
    w=A(i,k)/A(k,k)
    for j=k:n+1
    A(i,j)=A(i,j)-w*A(k,j)
    end
    end
    end
    A
    for i=n:-1:1
    s=0;
    for j=i+1:n
    s=s+A(i,j)*x(j);
    end
    x(i)=(A(i,n+1)-s)/A(i,i)
    end
    x
    106
    1. randa
       
      bonjour.s.v.p je veux un programme qui me permet de résoudre les systèmes d'équations linéaires avec la méthode de Gauss en MATLAB si le pivot est nul merci....
      0
    2. BN
       
      Nikel! Thank you!!!
      0