Re: matrix operation
- From: "John D'Errico" <woodchips@xxxxxxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 11:21:43 -0400
Johannes Deelstra wrote:
Hello,
How to solve the following problem?
I have a 12 x 12 matrix. I want each element in the respective
columns to be divided by the sum of that specific column. So, for
the
first column in a matrix A, element A(1,1)) has to be divided by
sum(A(:,1),1), A(1,2)/sum(A(:,1),1), etc.
How do I carry out this operation? How do I shortwrite this?
Regards
Johannes
A = A./repmat(sum(A,1),size(A,1),1);
HTH,
John
.
- References:
- matrix operation
- From: Johannes Deelstra
- matrix operation
- Prev by Date: Motion direction
- Next by Date: Re: Matlab copy-on-write behaviour
- Previous by thread: matrix operation
- Next by thread: Motion direction
- Index(es):