Hi I'm trying to make a procedure that will multiply all the diagonal entries of any random matrix together, this is what I have tried so far:
Diag := proc(A)
for i from 1 to n do
aux := 1;
aux := aux*U2(i,i);
but this just produces the last diagoinal entry of the matrix - how do I make the loop multiply the previous number by the next diagonal entry?
another option I've done is to make a list of the diagonal entries, but then I encounter the same problem with multiplication:
local n, List;
any help would be greatly appreciated!