what is the complexity of my gauss algorithm and how was it gotten step by step

1 vue (au cours des 30 derniers jours)
Ifechukwu
Ifechukwu le 15 Août 2014
Hi I av this function and I want to find its complexity but don't know how to calculate it pls can anyone help plus is there a method that can be used to calculate this in MATLAB
function [x,U] = gausselim(A,b) % function to perform gauss eliminination %FORWARD ELIMINATION n=length(b); m=zeros(n,1); x=zeros(n,1); for k =1:n-1; %compute the kth column of M m(k+1:n) = A(k+1:n,k)/A(k,k); %compute An=Mn*An-1, bn=Mn*bn-1 for i=k+1:n; A(i, k+1:n) = A(i,k+1:n)-m(i)*A(k,k+1:n); end; b(k+1:n)=b(k+1:n)-b(k)*m(k+1:n); end; U= triu(A);
%BACKWARD ELIMINATION x(n)=b(n)/A(n,n); for k =n-1:-1:1; b(1:k)=b(1:k)-x(k+1)* U(1:k,k+1); x(k)=b(k)/U(k,k); end; end

Réponses (0)

Catégories

En savoir plus sur Numerical Integration and Differential Equations dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by