[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Need help setting a flag once in sub.m when called from main.m
From: |
Jaroslav Hajek |
Subject: |
Re: Need help setting a flag once in sub.m when called from main.m |
Date: |
Tue, 9 Mar 2010 10:06:17 +0100 |
On Tue, Mar 9, 2010 at 9:29 AM, Svante Signell <address@hidden> wrote:
> Hi,
>
> I have the following problem:
>
> I need to call a subfunction once from the main function, setting a flag
> that it has been called. This should work as long as the workspace is
> not cleared. I can solve it by a persistent variable in the subfunction
> but it is not a nice solution.
>
> Code below:
>
> main.m:
> <how to declare status here?>
> status = sub(status);
> or
> status = sub();
>
persistent status = sub ();
--
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz