필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
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 CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by