Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: switchcase problem in R12 v6.1
Replies: 2   Last Post: Nov 16, 2012 9:51 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
sarma Ravi Krishna

Posts: 5
Registered: 10/1/05
switchcase problem in R12 v6.1
Posted: Oct 5, 2005 8:55 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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);



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.