[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: minors and cofactors
From: |
Dirk Laurie |
Subject: |
Re: minors and cofactors |
Date: |
Fri, 18 Sep 1998 16:16:28 +0200 (SAT) |
David D. Clark wrote:
>
> Are there octave commands for determining minors and cofactors without
> using the :
>
> i.e. is there a command like minor(i,j) will find the minor associated
> with the ith row and jth column. The cofactor is not as big an issue.
>
Pity, because the cofactor is the easy case:
cofA = inv(A).'*det(A)
The minors are a little harder:
[m,n] = size(A); k = ones(1,n); k(2:2:n) = -k(2:2:n); minA = (k'*k).*cofA
If you insist on not using the colon at all, there are tortuous ways
of generating the vector [1 -1 1 -1 ...] without it.
If you need cofactors of a singular or non-square matrix, the problem
is a good deal harder. In fact, I can't offhand think of a fast way
of doing it.
Dirk