help needed to understand Matlab behavior

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

help needed to understand Matlab behavior

John W. Eaton
Administrator
Given the attached fucntion, could someone please try

   [fh1, fh2] = test_hnf2 ()
   fh2 ()
   fh1 ()
   fh2 ()

in a recent version of Matlab and report the results here?

Thanks,

jwe

test_hnf2.m (179 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: help needed to understand Matlab behavior

rdzman
MATLAB R2019b on Mac.

>>  [fh1, fh2] = test_hnf2 ()

fh1 =

  function_handle with value:

    @test_hnf2/nested1


fh2 =

  function_handle with value:

    @test_hnf2/nested2

>>  fh2 ()

val =

     1

>>  fh1 ()

val =

     2

>>  fh2 ()

val =

     2


On Mar 5, 2020, at 8:41 AM, John W. Eaton <[hidden email]> wrote:

Given the attached fucntion, could someone please try

 [fh1, fh2] = test_hnf2 ()
 fh2 ()
 fh1 ()
 fh2 ()

in a recent version of Matlab and report the results here?

Thanks,

jwe
<test_hnf2.m>

Reply | Threaded
Open this post in threaded view
|

Re: help needed to understand Matlab behavior

Octave - Maintainers mailing list
In reply to this post by John W. Eaton
Hi John,

in an R2015a version I get

fh1 =

    @test_hnf2/nested1


fh2 =

    @test_hnf2/nested2


val =

     1


val =

     2


val =

     2



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html