[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Indexing confusion
From: |
Michael Grossbach |
Subject: |
Indexing confusion |
Date: |
Thu, 01 May 2008 16:39:35 +0200 |
User-agent: |
Thunderbird 2.0.0.12 (Windows/20080213) |
Assume a matrix
X = [1, 2; 3, 4];
To produce, say, the second element of the first row one would issue
X(1,2)
ans = 2
To obtain all combinations of elements in X I then use
fullfact(size(X))
ans =
1 1
1 2
2 1
2 2
To my confusion,
X(fullfact(size(X)))
produces
ans =
1 1
1 3
3 1
3 3
instead of the expected
ans =
1
2
3
4
Is this intended behaviour and am I missing something?
Using Octave 3.0 on Windows Vista.
Michael