octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help with indexing compatibility


From: Rik
Subject: Help with indexing compatibility
Date: Fri, 4 Nov 2016 15:21:01 -0700

11/4/16

Could someone try the following code in Matlab and report the orientation
of the output?

+verbatim+
x = [1 2 3];
x([3 2 1]')
x'([3 2 1])
-verbatim-

The rule, in Octave, seems to be that the return shape of scalars and
matrices is the shape of the object used to index them.  But for vectors
which are in turned indexed by a vector, the shape is that of the original
vector instead.  We are probably doing this for Matlab compatibility, but I
thought I would check.

Thanks,
Rik




reply via email to

[Prev in Thread] Current Thread [Next in Thread]