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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 integrate graphs
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Schippi

Austria
1 Posts

Posted - 12/17/2015 :  04:39:50 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 9.0
Operating System: Windows 7

Hello everyone,
this is my problem:
I have got a workbook with about 20 worksheets which I have to integrate and then to form the average value.
The program I have got works but it records everything in 1 workbook and within this workbook in 1 worksheet.
How can it be managed to get several worksheets.

Lots of thanks in advance!

// BEGIN SCRIPT
// PROMPT for X range and calculation method
ix1 = 1.0;
ix2 = 2322.0;
choice$ = Math Absolute;
ichoice = 1;
getn (From) ix1 (To) ix2 (Method) ichoice:choice$ (Integrate all plots);
// Setup
ichoice--;
newbook name:=Results;
layer.name$ = Areas;
range raData = 1;
range raArea = 2;
count = 0;
//range raAverage = 3;
cnt =0;
average= 0;
// Loop over all graphs then all plots in each graph
doc -e P
{
doc -e DY
{
count++;
range -w raC = %C;
xi1 = xindex(ix1,%C);
xi2 = xindex1(ix2,%C);
integ1 iy:=raC[xi1:xi2] baseline:=0 type:=$(ichoice) area:=myarea;
raData[count]$ = %C[x$(ix1):$(ix2)];
raArea[count] = myarea;
cnt = cnt +myarea ;
//raAverage [count] = cnt;
}
}
average= cnt / count;
raData[count + 1]$ = Mittelwert;
raArea[count + 1] = average;

SeanMao

China
288 Posts

Posted - 12/19/2015 :  03:59:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

If you want to output the integration results in different new sheets in a new book, you can run the following:

newbook myresults;

...
integ1 iy:=raC[xi1:xi2] baseline:=0 type:=$(ichoice) area:=myarea oy:=["myresults"]<new>!(<new>,<new>);
...

Give it a try and see how it goes.

Regards!

Sean

OriginLab Tech.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000