The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 store integration result

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
rpaczkowski Posted - 02/18/2005 : 4:06:45 PM
Origin Version (Select Help-->About Origin): 7.5
Operating System: Windows 2000

Hello everybody,

When doing an integration of x-y-values in a worksheet, the result (NOT the cumulative result) is stored in a variable called e.g.irMyResults with the command
IntegrationResult irMyResults;
Now I want to copy the integration result for every x-y-value into a column in the same worksheet of which the integration was done. By just using
printf("result = %f\n",irMyResults);
I get a general compile error.

For clarification: I really want the integration result for every x-y-pair, not the area under the whole curve.
2   L A T E S T    R E P L I E S    (Newest First)
rpaczkowski Posted - 02/21/2005 : 10:00:08 AM
easwar,

Thank you so much, that works just fine!

Ralph
easwar Posted - 02/18/2005 : 4:32:23 PM
Hi,

IntegrationResult is a structure that holds results such as peak area, position etc. It does not contain the resulting curve at each x value. Also it cannot be just printed directly using a print statement.

You can use code such as below, which is very similar to what is in the help file:

Easwar
OriginLab


void test_integ()
{
// Point to currently active worksheet
Worksheet wks = Project.ActiveLayer();
if( !wks ) return;

// Take first two cols and use for data curve
Curve crvData(wks, 0 , 1);
// Use 3rd to place Y for output curve
Dataset dsResultCurve(wks, 2);
if( !crvData || !dsResultCurve ) return;
// Set output col length same as input curve length
dsResultCurve.SetSize(crvData.GetSize());

// Declare structure to hold integration result and call function to integrate
IntegrationResult irResult;
bool bRet = Curve_integrate(&crvData, &irResult, NULL, &dsResultCurve);
if( !bRet ) printf("error!");

// Integrated curve will be in 3rd col
// To see result values such as area, can do the following:
Tree trResult;
trResult = irResult;
out_tree(trResult);
}




The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000