octave-maintainers
[Top][All Lists]
Advanced

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

Re: refactoring function handle implementation for version 6


From: John W. Eaton
Subject: Re: refactoring function handle implementation for version 6
Date: Thu, 11 Jun 2020 14:06:06 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 6/11/20 1:41 PM, Rik wrote:

Also, it seems that vectorize() has gone away in Octave, but it still exists in Matlab when applied to function handles.  The following code works

f = @(x,y) x * y
f = function handle with value:
    @(x,y)x*y
f2 = vectorize (f)
f2 = function handle with value:
    @(x,y)x.*y

The Matlab docs mark vectorize as "not recommended" and only state that the input can be a character vector, string scalar, or inline function object.

Octave's vectorize function has always been bad.  For example, try

  vectorize ("fprintf ('the file is: /foo/bar\n')")

in an old version.

If you think it is worth doing, I could probably restore the old buggy behavior for anonymous function handles and character strings.

jwe





reply via email to

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