On 25 May 2010, at 13:16, Alois Schlögl wrote: > No, its not possible to have a general purpose solution for the (...) > (:) > issue. Lets look at the following example [F (x-y)(:)]. > If F is a function, it should be converted to [vec(F(x-y))], but if > F is > a variable, the correct translation is [F vec(x-y)]. oct2mat can not > know which is correct, because it needs to know the context of this > expression. In worst case, whether F is a function or variable is > determined only at runtime.
Do you actually refer to the case where the expression is enclosed in square brackets? Then the syntax '[F (x-y)(:)]' is equivalent to [F, (x-y)(:)] no matter what 'F' is. If 'F' is a function and '(x-y)' are meant to be its arguments then '[F (x-y)(:)]' is just wrong and produces an error: >> f...@sin; x=pi; y=pi/2; >> [F (pi-pi/2)] error: octave_base_value::resize (): wrong type argument `function handle' error: octave_base_value::resize (): wrong type argument `<unknown type>' >> [F(pi-pi/2)] ans = 1 c. ------------------------------------------------------------------------------ _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev