|
From: | Ismael Núñez-Riboni |
Subject: | Re: Difference of columns |
Date: | Thu, 29 Aug 2013 13:30:06 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 |
Suppose that we have N columns in a matrix, how we can perform a program that take into account all possible differences between these N columns.
You need a double loop, I see no other (easy) way, if your matrix is A: cc = 1; for i = 1:N for j = 1:N diff(:,cc) = A(:,i) - A(:,j); cc = cc +1; end end Cheers, Ismael.
[Prev in Thread] | Current Thread | [Next in Thread] |