Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to check if a parameter is already in workspace
Date: Tue, 30 Jun 2009 17:52:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 23
Message-ID: <h2djc1$qo9$1@fred.mathworks.com>
References: <h2bggl$3rs$1@fred.mathworks.com> <h2bhel$3c3$1@fred.mathworks.com> <h2dip9$hh5$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246384321 27401 172.30.248.38 (30 Jun 2009 17:52:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 30 Jun 2009 17:52:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1477385
Xref: news.mathworks.com comp.soft-sys.matlab:551775


"Serkan " <serkanvai@gmail.com> wrote in message <h2dip9$hh5$1@fred.mathworks.com>...
> Hi
> how can i use "exist" in the M-Function of my GUI
> 
>         case 'PB_STARTSIM'
>             Check = evalin('base',(char(exist('Uk','var'))));
>             if Check == 1;
>                 open model;                
>                 evalin('base','sim model');
>             else
>                 errordlg('Please load the parameters at first','Error');
>             end
> 
> I have in the GUI a start simulation button. Before starting the simulation though i need to check if Uk is already in Workspace. If so 'model.mdl' will be opened and simulation will be started. But it doesnt work somehow.
> if you can help i would very appreciate
> greetings
> serkan ozturk

if exist('n','var')
    (do stuff)
else
~
end