need test run in recent version of Matlab

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

need test run in recent version of Matlab

John W. Eaton
Administrator
Steps to run:

* unpack attached fhtst.tar.gz

* in Matlab, cd to the fhtst directory, and execute the following commands:

   fh = foo ()
   fh (13)
   save fhtst.mat fh

* restart Matlab, cd to the fhtst directory, and execute the commands

   load fhtst.mat
   fh (42)

* post the output from the command window for the two sessions and the
fhtst.mat file here.

I'm trying to understand scoping of handles to sub functions and also
what info is available to create a function handle to a sub function
when the handle is loaded from a .mat file.

Thanks,

jwe


fhtst.tar.gz (356 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: need test run in recent version of Matlab

Alois Schloegl-7
On 01.03.19 07:50, John W. Eaton wrote:

> Steps to run:
>
> * unpack attached fhtst.tar.gz
>
> * in Matlab, cd to the fhtst directory, and execute the following
> commands:
>
>   fh = foo ()
>   fh (13)
>   save fhtst.mat fh
>
> * restart Matlab, cd to the fhtst directory, and execute the commands
>
>   load fhtst.mat
>   fh (42)
>
> * post the output from the command window for the two sessions and the
> fhtst.mat file here.
>
> I'm trying to understand scoping of handles to sub functions and also
> what info is available to create a function handle to a sub function
> when the handle is loaded from a .mat file.
>
> Thanks,
>
> jwe
>
>> fh = foo ()
fh =

  function_handle with value:

    @sub

>>   fh (13)

ans =

    'this is sub: 13'

>>   save fhtst.mat fh
>> exit

$ matlab -nodesktop
MATLAB is selecting SOFTWARE OPENGL rendering.

                                                                                                          
< M A T L A B (R) >
                                                                                                
Copyright 1984-2018 The MathWorks, Inc.
                                                                                                
R2018b (9.5.0.944444) 64-bit (glnxa64)
                                                                                                            
August 28, 2018

 
To get started, type doc.
For product information, visit www.mathworks.com.

>> load fhtst.mat
>>   fh (42)

ans =

    'this is sub: 42'

>


fhtst.mat (578 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: need test run in recent version of Matlab

John W. Eaton
Administrator
On 3/1/19 1:58 AM, Alois Schlögl wrote:
> On 01.03.19 07:50, John W. Eaton wrote:

>  [...]
 >
>>> load fhtst.mat
>>>     fh (42)
>
> ans =
>
>      'this is sub: 42'

Thanks for the quick reply.

jwe


Reply | Threaded
Open this post in threaded view
|

Re: need test run in recent version of Matlab

John W. Eaton
Administrator
In reply to this post by Alois Schloegl-7
On 3/1/19 1:58 AM, Alois Schlögl wrote:

> On 01.03.19 07:50, John W. Eaton wrote:
>> Steps to run:
>>
>> * unpack attached fhtst.tar.gz
>>
>> * in Matlab, cd to the fhtst directory, and execute the following
>> commands:
>>
>>    fh = foo ()
>>    fh (13)
>>    save fhtst.mat fh
>>
>> * restart Matlab, cd to the fhtst directory, and execute the commands
>>
>>    load fhtst.mat
>>    fh (42)
>>
>> * post the output from the command window for the two sessions and the
>> fhtst.mat file here.
>>
>> I'm trying to understand scoping of handles to sub functions and also
>> what info is available to create a function handle to a sub function
>> when the handle is loaded from a .mat file.
>>
>> Thanks,
>>
>> jwe


The file you attached is in MATLAB 5.0 MAT-file format.  Could you (or
someone) provide this file in the v7.3 format?  Sorry I didn't specify
that in the original message.

Thanks,

jwe



Reply | Threaded
Open this post in threaded view
|

Re: need test run in recent version of Matlab

Alois Schloegl-7
On 01.03.19 08:33, John W. Eaton wrote:

> On 3/1/19 1:58 AM, Alois Schlögl wrote:
>> On 01.03.19 07:50, John W. Eaton wrote:
>>> Steps to run:
>>>
>>> * unpack attached fhtst.tar.gz
>>>
>>> * in Matlab, cd to the fhtst directory, and execute the following
>>> commands:
>>>
>>>    fh = foo ()
>>>    fh (13)
>>>    save fhtst.mat fh
>>>
>>> * restart Matlab, cd to the fhtst directory, and execute the commands
>>>
>>>    load fhtst.mat
>>>    fh (42)
>>>
>>> * post the output from the command window for the two sessions and the
>>> fhtst.mat file here.
>>>
>>> I'm trying to understand scoping of handles to sub functions and also
>>> what info is available to create a function handle to a sub function
>>> when the handle is loaded from a .mat file.
>>>
>>> Thanks,
>>>
>>> jwe
>
>
> The file you attached is in MATLAB 5.0 MAT-file format.  Could you (or
> someone) provide this file in the v7.3 format?  Sorry I didn't specify
> that in the original message.
>
> Thanks,
>
> jwe
>
>
v7.3 is attached

Cheers,

  Alois




fhtst.mat (17K) Download Attachment