I need help in developing a function file GE_m(A,b) to determine the pivot row r such that a(rk) is the first nonzero entry among a(kk),a(k+1)...a(n,k). if a(kk)=a(k+1,k)=a(nk)=0 then pivot out that 'A is not invertible' and quit.
Show older comments
%I need help in developing a function file GE_m(A,b) to determine the pivot row r
% such that a(rk) is the first nonzero entry among a(kk),a(k+1)...a(n,k).
% if a(kk)=a(k+1,k)=a(nk)=0 then pivot out that 'A is not invertible' and quit.
% this is the other function i will be calling in my comand window and this function is correct
%function x=ut_sys(U,c)
%n=length(U);
%x=zeros(n,1);
%x(n)=c(n)/U(n,n);
%for i=n-1:-1:1
% s=0;
% for j=n:-1:i+1
%s =s+U(i,j)*x(j);
% end
% x(i) = (c(i)-s) /U(i,i);
%end
%end
% i need help with the function below!! i cannot get it working
function [A,b]=GE_m(A,b)
n =length(b);
for k=1:n-1
ap=abs(A(k,k));
r=k;
while ap < (n)*e-15
r=r+1;
end
end
if ap , (n)*e-15
disp('A is not invertible');
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Specialized Power Systems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!