From: Jack Branning on
Does anybody know of a function that enables me to lexicographically order the numeric entries of each row of an array?

Thanks.
From: Rune Allnor on
On 22 Feb, 14:48, "Jack Branning" <jbr.nos...(a)nospam.com> wrote:
> Does anybody know of a function that enables me to lexicographically order the numeric entries of each row of an array?

SORT is an obvious first candidate... you would need to
call it recursively on the columns, though.

Rune

From: Oleg Komarov on
"Jack Branning" <jbr.nospam(a)nospam.com> wrote in message <hlu1um$a04$1(a)fred.mathworks.com>...
> Does anybody know of a function that enables me to lexicographically order the numeric entries of each row of an array?
>
> Thanks.

Can you post an example of the input and the desired output?

Oleg
From: Jack Branning on
Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <876e2a02-1f24-4fc6-b490-7d2864fa0a2a(a)y17g2000yqd.googlegroups.com>...
> On 22 Feb, 14:48, "Jack Branning" <jbr.nos...(a)nospam.com> wrote:
> > Does anybody know of a function that enables me to lexicographically order the numeric entries of each row of an array?
>
> SORT is an obvious first candidate... you would need to
> call it recursively on the columns, though.
>
> Rune

wow, I really over-complicated that one! I was searching for "lexicographical ordering", "order" etc. and forgot the obvious - "sort"!

Thanks, that was a great help!
From: Jack Branning on

> > SORT is an obvious first candidate... you would need to
> > call it recursively on the columns, though.
> >
> > Rune

Actually, I'm now wondering if "sort" is the right function for lexicographical ordering. I am trying to implement something from a paper, which reads:

"To identify the identical rows, the rows of the matrix A are lexicographically ordered (as B×B integer tuples). This can be done in MNlog2(MN) steps. The matching rows are easily searched by going through all MN rows of the ordered matrix A and looking for two consecutive rows that are identical."

where BxB represents a 3x3 sliding window...

I can't seem to find a good definition of lexicographical ordering that can be applied to this context. Does anyone have any ideas?
 |  Next  |  Last
Pages: 1 2 3 4 5
Prev: winqueryreg
Next: convert video as .wmv to . avi format