octave-maintainers
[Top][All Lists]
Advanced

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

Re: adding an op


From: Bill Denney
Subject: Re: adding an op
Date: Wed, 1 Jun 2005 15:45:45 -0400 (EDT)

On Wed, 1 Jun 2005, John W. Eaton wrote:

It seems to me that it should be a cell array of values, and that the
values would be the result of the element-by-element operations.  Then
an expression like

 {[1,2,3], 1, "xyz"} == {[3,2,1], 2, "zyx"}

would produce

 {[0,1,0], 0, [0,1,0]}

(with all elements having a logical type).

Another good test would be the ability to do cell to single value comparisions such as:

{'abc', [1 2 3], uint8(2)} == 2

which would return

{[0 0 0], [0 1 0], 1}

I assume that you meant this, too, but I wanted to make sure because I think it's useful and a good generalization. I don't know, however, if it would significantly slow down the process (in either coding or execution time).

Does that seem reasonable?  Attempting to compare structures would
fail until someone implements the corresponding operators for
structures, which I suppose could be handled in a similar
element-by-element fashion.  Would this really be useful?

I've written innumerable loops to do just this (without the generalization); I think it would be very helpful.

Bill

--
"I don't have a chance of writing the book,
I just want to be a page in Jeannie's diary."
  -- E



reply via email to

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