Path: news.mathworks.com!not-for-mail
From: "Steven_Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: What is wrong with this code?
Date: Fri, 19 Apr 2013 11:23:41 -0400
Organization: MathWorks
Lines: 38
Message-ID: <kkrnhs$ekd$1@newscl01ah.mathworks.com>
References: <kkpg3a$rij$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: ah-slord.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="utf-8";
	reply-type=response
Content-Transfer-Encoding: 7bit
X-Trace: newscl01ah.mathworks.com 1366385020 14989 172.28.9.169 (19 Apr 2013 15:23:40 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 19 Apr 2013 15:23:40 +0000 (UTC)
In-Reply-To: <kkpg3a$rij$1@newscl01ah.mathworks.com>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
Xref: news.mathworks.com comp.soft-sys.matlab:793918



"Daniel " <djtilley@student.bradford.ac.uk> wrote in message 
news:kkpg3a$rij$1@newscl01ah.mathworks.com...
> i have a function for an ODE but i keep on getting this message
>
> Error in ode_second_fun_main (line 5)
> [x,y]=ode45(@second_fun,tspan,x0,options);

Since you didn't give the full text of the error message, I will (line 
numbers may be a little different depending on the version of MATLAB you're 
using.)

Error using odearguments (line 91)
SECOND_FUN must return a column vector.

Error in ode45 (line 114)
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0,
f0, odeArgs, odeFcn, ...

Error in ode_second_fun_main (line 5)
[x,y]=ode45(@second_fun,tspan,x0,options);

Have you checked whether or not your second_fun function returns a column 
vector? Try putting this line right before your call to ODE45 in 
ode_second_fun_main to check:

second_fun(0, x0)

Modify second_fun so that it does return a _column_ vector and see if that 
fixes the problem.

-- 
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on 
http://www.mathworks.com