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

2 ビュー (過去 30 日間)
Ifechukwu
Ifechukwu 2014 年 8 月 15 日
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

回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by