integrate two vectors of data

Hi all
I have two vectors of data. They are the same length. I want to multiply them and integrate over a distance. How can I do this in MATLAB?
I saw many people asking the same question and no answer. Does it mean it cannot be done in MATLAB?!

 Accepted Answer

KSSV
KSSV on 29 Nov 2016
doc trapz.

3 Comments

let me explain my purpose in a better way. I have a matrix 'p' of 300*300 drawn over x and y. So I have 2D plot of p. I want to integrate this p over x and y and then plot the resultant 300*300 matrix.
Trapz gives only one value!
Never mind. You are right. I got my value now
cool....you got it..

Sign in to comment.

More Answers (0)

Asked:

on 29 Nov 2016

Commented:

on 29 Nov 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!