for my m-script i need to check if a parameter is already in workspace.
there was something like isvar(parameter) or like that which gives boolean 1 for yes and 0 for no..
thanks for any help
serkan ozturk
Subject: how to check if a parameter is already in workspace
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
Subject: how to check if a parameter is already in workspace
"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'))));
should read
res=evalin('base','exist(''Uk'',''var'');');
us
Subject: how to check if a parameter is already in workspace
"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
Subject: how to check if a parameter is already in workspace
Hi
I have two S-Function blocks(S1 and S2) which accepts one parameter each.
How to check whether S1 and S2 both contains same parameter value?
(I mean, if S1 has parameter value "1", I need to restrct S2 parameter value taking "1")
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.