The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.