Got Questions? Get Answers.
Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Quadrature method using vectors

Subject: Quadrature method using vectors

From: Kyle

Date: 28 Apr, 2011 19:37:05

Message: 1 of 2

I was wondering if anyone knew of a method in MATLAB to numerically integrate a function using a quadrature method with a vector rather than a function as the input (step size/location defined by a second vector). The system of integrals I am attempting to integrate are coupled such that an explicit function cannot be passed to a quad(fun,a,b) type MATLAB function. I'd be happy to post the systems of integrals if you're interested.

Writing the code for a vector based quadrature method shouldn't be too bad but it would be nice to save the time if I didn't have to do it.

Any ideas?

Subject: Quadrature method using vectors

From: Roger Stafford

Date: 28 Apr, 2011 20:25:14

Message: 2 of 2

"Kyle" wrote in message <ipcfl1$90k$1@fred.mathworks.com>...
> I was wondering if anyone knew of a method in MATLAB to numerically integrate a function using a quadrature method with a vector rather than a function as the input (step size/location defined by a second vector). The system of integrals I am attempting to integrate are coupled such that an explicit function cannot be passed to a quad(fun,a,b) type MATLAB function. I'd be happy to post the systems of integrals if you're interested.
>
> Writing the code for a vector based quadrature method shouldn't be too bad but it would be nice to save the time if I didn't have to do it.
>
> Any ideas?
- - - - - - - - -
  Matlab's function 'trapz' does numerical integration with specified variable step sizes using the trapezoidal rule. Also FEX has other quadrature functions with variable step sizes written by other individuals (including myself) that use higher order approximations.

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us