mapley

12 Reputation

2 Badges

17 years, 318 days

MaplePrimes Activity


These are answers submitted by mapley

It is an exercise, i have two weeks to prepare it and i never work with maple before. So far..i've been working out with this. Me try to locate the maximum element A[p,q] out of matrix A[i,j]..then, problem occur at the row exchange...can we discuss? #loop over pivot diagonale > for k from 1 to n-1 do; > #searching for maximal element A[p,q] among all element matrix A[i,j] > for i from k to n do; > for j from k to n do > a_max:=0; > a:=abs(A[i,j]); > if a >a_max then > a_max:=a; > p:=i;#row index > q:=j;#index index > fi; > od; > od; > > #If the maximum is 0 then matrix is singular > if a_max = 0 then > error("Singular matrix"); > fi; > > > #exchange row > if k < p then > for j from 1 to n do > c:=A[p,j]; > A[p,j]:=A[k,j]; > A[k,j]:=c; > od; > fi; Error, initial value in for loop must be numeric or character Error, Singular matrix Error, cannot determine if this expression is true or false: k < p
Page 1 of 1