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: Why is this function returning a vector of length 1?
Replies: 3   Last Post: Jan 16, 2013 12:39 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Phil Goddard

Posts: 350
Registered: 1/27/12
Re: Why is this function returning a vector of length 1?
Posted: Jan 16, 2013 12:39 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


Assuming you want to use the default options then just specify it as an empty matrix,
>> [x,p]=ode45('MathieuDamped',[0 1000],[1,0],[],a,b,q);

Also, I'd highly recommend you read up on function handles and why the cost function should be specified using them.
At a minimum you want
>> [x,p]=ode45(@MathieuDamped,[0 1000],[1,0],[],a,b,q);

Phil.



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.