|
|
switchcase problem in R12 v6.1
Posted:
Oct 5, 2005 8:55 AM
|
|
iam encountering a strange problem using switch case. i'am trying call a function named trial (trial.m) and calling it from command prompt using ode15s, but i get a error saying unknown flag 'init'. MATLAB6.1 R12
details given below::::::PLZ help me out:::::::::
M-file name trial
function varargout= trial (t, c, flag)
switch flag case '' varargout{1}=f(t,c);
case 'jpattern'
varargout{1} = jpattern(t,c);
case 'mass'
varargout{1} = mass(t,c); otherwise error(['Unknown flag ''' flag '''.']); end % ------------------------------------------------------------
function S = jpattern(t,c) %code for jpattern
%---------------------------------------------------------------
function M = mass(t,c) %code for mass %---------------------------------------------------------------
function Gi=jacobianri(t,cp) %code for jacobianri %---------------------------------------------------------------
while running at command prompt!!
options=odeset('OutputFcn','odeplot','OutputSel',[ind],'JPattern','on' ,'Mass','on');
[t c Y]= ode15s('trial',[0 ta], cinit,options);
---------------------------------------------------------------- ERRORS Encountered!!!!
??? Error using ==> trial Unknown flag 'init'..
Error in ==> E:\MATLAB\toolbox\matlab\funfun\private\odearguments.m On line 53 ==> [def_tspan,def_y0,def_options] = feval(ode,[],[],'init',extras{:});
Error in ==> E:\MATLAB\toolbox\matlab\funfun\ode15s.m On line 212 ==> [neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, args, ...
Error in ==> ..\test.m On line 61 ==> [t c Y]= ode15s('trial',[0 ta], cinit,options,flag);
|
|