Since Matlab doesn't distinguish between arrays and scalars, it's a perfectly reasonable mistake. I also would naively have expected it to return a scalar, but I've never used quadgk so I really have no idea.
All this will be easier to figure out when we have a debugger. --Tim On Wednesday, October 01, 2014 07:26:08 AM [email protected] wrote: > Good god, what a terrible newbie mistake - I figured by doing > quadgk(...)[1] I had brought the result down to a scalar, but I have to do > quadgk(...)[1][1] instead! > Glad I at least accidentally discovered a 'bug' in the optimize routine, so > I didn't just waste everyone's time with this...
