Hi Oliver,
The function in OC goes like this,
void integral_normalize()
{
BOOL bErr;
Layer lyAct=Project.ActiveLayer(); // get active layer
Worksheet wks = lyAct; // get the worksheet
Dataset dsX( wks, 0 ); // col(A) as X
Dataset dsY( wks, 1 ); // col(B) as Y
Curve crvMyCurve( dsX, dsY ); // Create Curve object to integrate
IntegrationResult irMyResults; // Origin C structure to store integration results
bErr = Curve_integrate( &crvMyCurve, &irMyResults, NULL, NULL, TRUE ); // Perform integration
double dIntegral = irMyResults.Area; // get the integration result.
dsY = dsY/dIntegral; // normalize the data
}
Assume col(A) and col(B) are X and Y respectively, if not, you can do some modification on the code.
Compile and execute the function in Code Builder with the worksheet active, then Col(B) will be normalized.
It is tested under Origin75Pro SR6, OS: XP-sp2.
Hope it helps.
Zachary
OriginLab GZ Office
Edited by - zachary_origin on 06/14/2006 01:14:42 AM