Am 14.02.2012 um 15:05 schrieb Jordi Gutiérrez Hermoso:

> These all seem like very trivial wrappers to cellfun. Or not even
> cellfun, a lot of this can already be done with boolean indexing:
> 
>    A = pascal(3);
>    A(A>=3) ## "reject" or "select"

Jordi,

I just read your message again, and it seems that the root of all confusion 
seems to be my ignorance of boolean indexing. Had I been aware of that, I 
wouldn't have coded all the stuff anyway. I really agree that in this light my 
functions are additional syntax without a lot of benefit.

So I just had another look at the documentation for index expressions, and 
although boolean indexing works perfectly in 3.4.2 the documentation states that

"An "index expression" allows you to reference or extract selected
elements of a matrix or vector.

   Indices may be scalars, vectors, ranges, or the special operator
`:', which may be used to select entire rows or columns."

The "Logical Values" section, however, states that 

"Logical values can also be used to index matrices and cell arrays. When 
indexing with a logical array the result will be a vector containing the values 
corresponding to true parts of the logical array."

I really think the documentation should be updated here!

As for cellfun, it might be helpful to mention in the documentation that the 
function to be applied to the cells need not return a value at all. The current 
form suggests that cellfun is all about applying functions to cells and 
collecting the return values, although you can do basically anything like 
saving, plotting, and whatnot.

Regards,

        Alex

-- 
          Dr. Alexander Klein, Diplom-Mathematiker

Physiologisches Institut       |               TransMIT-Bereich
Raum 543                       |     für Mathematische Analysen
                               |          und Feld-Simulationen
Aulweg 129                     |          Heinrich-Buff-Ring 44
35392 Giessen                  |                  35392 Giessen


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to