[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: numel(foo{:}) - feature or bug ?
From: |
Marco atzeri |
Subject: |
Re: numel(foo{:}) - feature or bug ? |
Date: |
Sat, 06 Aug 2011 08:56:11 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20110624 Thunderbird/5.0 |
On 8/6/2011 8:03 AM, Sergei Steshenko wrote:
:
I supect you are thinking as foo(:) and foo{:} as
equivalent
but they are not.
So, how does your example answer my question:
"
Why does adding an element causes non-monotonicity in numel(foo2d{:}) ?
"
because numel is not supposed to handle food2d{:} and
it is producing only garbage-like output.
It should refuse to work as size and class do.
To convice you that food2d{:} is not an object, but it is more a
list of objects.
class(foo2d{:})
class(foo2d(:))
Or try this
p=food2d{:}
p=food2d(:)
the assignment uses just the first element of food2d{:},
numel seems to multiply the sizes of different level
(so, in my opinion, garbage).
foo =
{
[1,1] = [](0x0)
[2,1] = aa
[1,2] = b
[2,2] =
1 2 3 4
}
octave:24> numel(foo{:})
ans = 8
foo =
{
[1,1] =
1 2 3 4
[2,1] = aa
[1,2] = b
[2,2] = [](0x0)
}
octave:27> numel(foo{:})
ans = 0
Thanks,
Sergei.
Regards
Marco
- Re: numel(foo{:}) - feature or bug ?, (continued)
- Re: numel(foo{:}) - feature or bug ?, Ben Abbott, 2011/08/05
- Re: numel(foo{:}) - feature or bug ?, Sergei Steshenko, 2011/08/05
- Re: numel(foo{:}) - feature or bug ?, Sergei Steshenko, 2011/08/05
- Re: numel(foo{:}) - feature or bug ?, Jordi GutiƩrrez Hermoso, 2011/08/05
- Re: numel(foo{:}) - feature or bug ?, Sergei Steshenko, 2011/08/05
- Re: numel(foo{:}) - feature or bug ?, Sergei Steshenko, 2011/08/05
- Re: numel(foo{:}) - feature or bug ?, Marco atzeri, 2011/08/05
- Re: numel(foo{:}) - feature or bug ?, Sergei Steshenko, 2011/08/06
- Re: numel(foo{:}) - feature or bug ?,
Marco atzeri <=
- Re: numel(foo{:}) - feature or bug ?, Sergei Steshenko, 2011/08/06
- Re: numel(foo{:}) - feature or bug ?, Marco atzeri, 2011/08/06
- Re: numel(foo{:}) - feature or bug ?, Sergei Steshenko, 2011/08/06
- Re: numel(foo{:}) - feature or bug ?, Jordi GutiƩrrez Hermoso, 2011/08/05
- Re: numel(foo{:}) - feature or bug ?, Sergei Steshenko, 2011/08/05
- Re: numel(foo{:}) - feature or bug ?, Sergei Steshenko, 2011/08/05
- Re: numel(foo{:}) - feature or bug ?, fork, 2011/08/05
- Re: numel(foo{:}) - feature or bug ?, Sergei Steshenko, 2011/08/06