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'.

details given below::::::PLZ help me out:::::::::

M-file name trial

function varargout= trial (t, c, flag)

switch flag
case ''

case 'jpattern'

varargout{1} = jpattern(t,c);

case 'mass'

varargout{1} = mass(t,c);

error(['Unknown flag ''' flag '''.']);
% ------------------------------------------------------------

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!!


[t c Y]= ode15s('trial',[0 ta], cinit,options);

ERRORS Encountered!!!!

??? Error using ==> trial
Unknown flag 'init'..

Error in ==>
On line 53 ==> [def_tspan,def_y0,def_options] =

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],

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

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.