From bug-octave-request at bevo dot che dot wisc dot edu Wed Sep 30 08:58:01 1998 Subject: Unidentified subject! From: "John W. Eaton" To: Ben Kao Cc: bkao at ai dot uic dot edu, bug-octave@bevo.che.wisc.edu Date: Wed, 30 Sep 1998 08:57:56 -0500 (CDT) On 30-Sep-1998, Ben Kao wrote: | To: bug-octave at bevo dot che dot wisc dot edu | Cc: bkao at ai dot uic dot edu | Subject: matrix indexing bug? | | Bug report for Octave 2.0.13 configured for i686-pc-linux-gnulibc1 | | Description: | ----------- | Octave 2.0.13: | | octave:14> a(1) = 1 | a = 1 | octave:15> a(2) = 2 | a = | | 1 | 2 | | Matlab 5: | >> a(1) = 1 | a = | 1 | >> a(2) = 2 | a = | 1 2 | | As you can see the matrix grows in a different direction. | Is this a bug? At least this seems to be an inconsistency. | | Fix: | --- | | If a matrix is explicitly defined, (i.e. matrix(x,y) = ...) there is no | problem since we know x denotes column number and y denotes row number. | However, if the matrix is one dimensional (i.e. matrix(x)) then although | it is more or less arbitrary whether this is a row or column matrix, it | is ambiguous _when_the_matrix_is_first_defined_. Thus there should be | (probably is) a rule or convention that addresses this matter. I noticed | that 2.0.9 and 2.0.13 are consistent with each other at least. Has Matlab | always done it the other way? Yes, I think so, and I believe it doesn't offer you a choice about which you prefer. You can control Octave's behavior by setting the built-in variable prefer_column_vectors to 1 or 0. jwe