Add seealso strings to list- related functions.
John W. Eaton
jwe at bevo.che.wisc.edu
Wed Jan 16 13:24:20 CST 2008
On 16-Jan-2008, Søren Hauberg wrote:
| I see some sense in this behaviour. If I write
|
| a = 1,2,3,4,5,6,7
|
| then the interpreter would assign a the value 1, and treat 2,3,4,5,6,7
| as six separate expressions. If I now define a cell array that contains
| the values 1 to 7,
|
| c = {1,2,3,4,5,6}
|
| Now, c{:} gives me the following comma separated list: 1,2,3,4,5,6,7. If
| I write
|
| a = c{:}
|
| in an un-patched Octave I would get an error even if this expression is
| conceptually the same as the first expression. So, why should these
| expressions be different?
Even in Matlab, they are still different. In the first case, you get
>> a = 1, 2, 3
a =
1
ans =
2
ans =
3
But in the second, with the c-s list, you get
>> c = {1, 2, 3};
>> a = c{:}
a =
1
If these were really treated as equivalent, then you should also see
the ans = 2, ans = 3 outputs in the second case.
Also, while
[a, b, c] = c{:}
"works",
[a, b, c] = 1, 2, 3
does not.
But hey, you pointed out an incompatible thing that was easy to fix, I
felt like fixing it, and doing so is a preemptive strike against a
future complaint about how Octave sucks because it does not copy this
particular strange feature of Matlab.
OK, by now I've definitely spent too much time on this issue.
jwe
More information about the Bug-octave
mailing list