- #1
tramar
- 53
- 0
I have a data curve with discrete time points that I imported into MATLAB. The x-axis is an array named t:
The y-axis named Cp:
The plot of the curve looks like this:
[PLAIN]http://dl.dropbox.com/u/11932911/Cp.jpg
Essentially I want to integrate the function from zero to one of the time points. I tried using the functions quad and trapz but they seem to return red error messages. The function trapz works when I integrate over the entire curve (trapz(Cp)) but it won't let me specify an integration interval.
Code:
t =
1.0e+003 *
0.0319
0.0505
0.0851
0.1037
0.1356
0.1648
0.2021
0.2313
0.3616
0.5823
0.8880
1.1778
1.4996
1.7814
The y-axis named Cp:
Code:
Cp =
1.0e+004 *
0.0077
0.7846
3.7077
3.2923
1.8769
1.3769
1.0539
0.7769
0.5462
0.3923
0.2692
0.1846
0.1462
0.1385
The plot of the curve looks like this:
[PLAIN]http://dl.dropbox.com/u/11932911/Cp.jpg
Essentially I want to integrate the function from zero to one of the time points. I tried using the functions quad and trapz but they seem to return red error messages. The function trapz works when I integrate over the entire curve (trapz(Cp)) but it won't let me specify an integration interval.
Last edited by a moderator: