MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

### Discover what MATLAB® can do for your career.

 Subject: Nested integration using quad From: Steven_Lord Date: 14 Apr, 2011 13:35:49 Message: 7 of 7 "Erim " wrote in message news:io5vou$k0e$1@fred.mathworks.com... > Hi, I have a similar problem. I'd like to have a second opinion on what I > am doing. > I'm carrying out a double integration, where the lower limit of the inner > integral is the variable used in the outer integral. The function that is > passed to the first quad call, say y = fun(x), accepts a vector argument x > and returns a vector result y, the integrand evaluated at each element of > x. I set up a for loop in this function fun(x) so that it calls quad again > for each element of x. Therefore, eventually, the integrand of the first > integral (or the first quad call) is calculated (at each element of x) via > another quad call. Use QUAD2D instead. See example 2 on the reference page. http://www.mathworks.com/help/techdoc/ref/quad2d.html -- Steve Lord slord@mathworks.com To contact Technical Support use the Contact Us link on http://www.mathworks.com