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
 LabTalk Forum
 Automate Integration

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
starpuma Posted - 04/22/2014 : 12:24:58 AM
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8.5
Operating System: Windows 7

Hey everybody,

I posted this in wrong forum by mistake. Sorry about that. I have no clue about programming so please bear with me. So, I need to integrate a an upwards of 100 graphs and each one of them have about 200 traces each. So, far I have been using the "Integrate" gadget in Origin but I am nowhere close to being done.

So the main problem is that we can only integrate one trace or curve at a time with the "integrate" gadget and since all my integrations have the same basic parameters I figured that it would be relatively easy to automate this rather daunting task because since this is such a repetitive task. I am basically doing an absolute integration over a specific X range. I found this LabTalk script "Integrate Active Curve in Graph over a Specific X Range" from the origin's website (http://www.originlab.com/doc/LabTalk/examples/Peaks-and-Baseline) that almost does what I want. Here is the code:


The following example shows how to integrate the active curve in a graph over a specific range of x values, using the integ1 X-Function.

// Purpose: This example demonstrates the following:
// 1. import a file
// 2. create a graph
// 3. integrate the curve over a specific x range


// Create new book and import a sample file
newbook;
string fname$ = system.path.program$ + "samples\curve fitting\multiple peaks.dat";
impasc;

// Plot 4th column against 1st column as a line plot
plotxy iy:=(1,4) plot:=200;

// Get row index for x values of 6.5 and 9.5, which covers the 3rd peak in the graph
int ix1=xindex(6.5,%c);
int ix2=xindex(9.5,%c);

// Integrate this range of the curve, and list the results of integration
range rr=(%c)[$(ix1): $(ix2)];
integ1 rr;
integ1.=;

______________________________________

So according to my understanding this basically does what the integration gadget does? But I don't know if this will give me a mathematical or absolute integration.
Here is what I need: I have all the graphs plotted so could somebody please help me modify this code so it would go through all the traces or curves in a graph and integrate them. I would love you forever


Thank you so much!
1   L A T E S T    R E P L I E S    (Newest First)
lkb0221 Posted - 04/22/2014 : 10:42:31 AM
Hi,

Would you mind send an Email to <tech@originlab.com>, with your serial number? And the I can email you back the script.

Zheng
OriginLab

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