need test run in Matlab

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

need test run in Matlab

John W. Eaton
Administrator
In a recent version of Matlab, what do the attached scripts do?

With the attached scripts in your load path, could someone please try
the following commands in Matlab and report the results here.

   ascript   %% Error about code after local function
             %% definition or something else?

   bscript   %% Expect nothing.
   bscript1  %% Error about undefined function (assume
             %% local function is not accessible outside
             %% of script)?

Thanks,

jwe

ascript.m (127 bytes) Download Attachment
bscript.m (47 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: need test run in Matlab

fmlburgers
Op 22-4-2019 om 22:12 schreef John W. Eaton:

> In a recent version of Matlab, what do the attached scripts do?
>
> With the attached scripts in your load path, could someone please try
> the following commands in Matlab and report the results here.
>
>    ascript   %% Error about code after local function
>              %% definition or something else?
>
>    bscript   %% Expect nothing.
>    bscript1  %% Error about undefined function (assume
>              %% local function is not accessible outside
>              %% of script)?
>
> Thanks,
>
> jwe

 >> version
ans = '9.5.0.1049112 (R2018b) Update 3'

 >> ascript
Error: File: ascript.m Line: 8 Column: 1
Function definitions in a script must appear at the end of the file.
Move all statements after the "ascript1" function definition to before
the first local function definition.

 >> bscript

 >> bscript1
Undefined function or variable 'bscript1'.