help-octave
[Top][All Lists]
Advanced

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

Re: numel(foo{:}) - feature or bug ?


From: John W. Eaton
Subject: Re: numel(foo{:}) - feature or bug ?
Date: Sat, 6 Aug 2011 14:37:58 -0400

On  6-Aug-2011, Ben Abbott wrote:

| >From my reading of the discussion, I'm skeptical that everyone
| >understands that foo{:} is a cs-list, or maybe don't understand
| >cs-lists?

I think people are also missing another important part of all of this,
which is that when you call numel with more than one argument, as in

  numel (A, IDX2, IDX2, ...)

Then numel returns the number of elements that would result from the
indexing

  A(IDX1, IDX2, ...)

This method is also called when an object appears as lvalue with
cs-list indexing, i.e., `object{...}' or `object(...).field'.

The above is taken directly from the doc string for numel from Octave
3.4.2.  As I understand it, numel works this way so that it can be
used to compute the size of the object that is produced when indexing
user-defined objects (i.e., @CLASS style objects).

So I don't think the current behavior is a bug.

jwe


reply via email to

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