Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: Why is this function returning a vector of length 1?

$
0
0

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.

Viewing all articles
Browse latest Browse all 19628

Trending Articles