On 16-Sep-2004, Teemu Ikonen <

[hidden email]> wrote:

| Matlab:

| >> ff = inline('f(x)', 'f', 'x')

| ff =

| Inline function:

| ff(f,x) = f(x)

| >> ff(@sin, 1)

| ans =

| @sin

| >> version

| ans =

| 6.5.0.180913a (R13)

I think this has changed. In R13, function handles were an array

type, so indexing them picked an element from the array. In R14, they

made them a scalar type only, so indexing them performs a function

call. So in the above, you are selecting the first element of the

function handle array stored in f. Try

ff (@sin, 2)

and see if you don't get a different result (range error on the

index).

With the new behavior, I would expect Matlab to be compatible with the

current Octave behavior and call the sin function through the function

handle with the argument 1.

jwe