octave-maintainers
[Top][All Lists]
Advanced

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

Re: concatenation bug?


From: David Bateman
Subject: Re: concatenation bug?
Date: Fri, 13 Apr 2007 12:05:39 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

John W. Eaton wrote:
> Is there some reason that the following must fail?
>
>   x = {1, 2};
>   [x, @sin]          
>   error: concatenation operator not implemented for `cell' by `function 
> handle' operations
>
> It seems that Matlab barfs on this as well, but I don't see why.
>   
I see no reason for this to fail.. The operand should be promoted to a
cell array before concatenation in this case, equivalent to "[x,
address@hidden", which works both in octave and matlab if @sin is explicitly
encapsulated in a cell array first. I'd suggest that all types should
have a widening operation to allow this.

> The reason I want to use it is to do something like this:
>
>   args = {x, y};
>   args = [args, @somefun];
>   anotherfun (args{:});
>
> Note that the following does work in Matlab:
>
>   args = address@hidden;
>   args = [args, pi/2];
>   feval (args{:});
>
> jwe
>
>   
Regards
David


-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



reply via email to

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