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
 Integration of coloumn

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
babia Posted - 11/27/2015 : 02:18:05 AM
Hi,

I have a small problem:

i have some workbooks and i want to integrate the 2nd column with respect to 1st column for each of the workbook. The area so obtained after integration, i want to put that value in another workbook.

Please help.

Regards,
Babia
8   L A T E S T    R E P L I E S    (Newest First)
babia Posted - 12/03/2015 : 05:35:29 AM
Perfect.

Thanks a lot.

Regards,
Rajesh Agarwal
SeanMao Posted - 12/03/2015 : 03:45:58 AM
Hi,

You can check out the following code:



newbook name:="Average Current" sheet:=1; 
Col(1)[L]$="Frequency";
Col(2)[L]$="Area";
Col(3)[L]$="Abs(Area)";
Col(4)[L]$="Time";
Col(5)[L]$="Average";
Col(6)[L]$="Normalized";
Col(1)[U]$="Hz";

wautosize; // auto size the col width

col(1)={100,500,1000,5000,10000,20000,40000,50000,70000,90000,100000,120000,150000,200000};//Frequency

col(4)={0.02,0.004,0.002,4E-4,2E-4,1E-4,5E-5,4E-5,2.858E-5,2.22E-5,2E-5,1.666E-5,1.332E-5,1E-5};//Time

csetvalue col:=[ Average Current]Sheet1!col(3) formula:="abs(col(2))" recalculate:=1;
csetvalue col:=[ Average Current]Sheet1!col(5) formula:=" col(3)/col(4)" recalculate:=1;
csetvalue col:=[ Average Current]Sheet1!col(6) formula:=" col(3)/1e-12" recalculate:=1;

ii=1;
Doc -ef W
{
	if (page.longname$!="Average Current")
	{
		integ1 iy:=(Col(1), Col(2)) area:=area; // integrate col 2 wrt col 1
		range rTemp = ["Average Current"]1!col("Area")[$(ii)];
		rTemp = area;
		ii++;
	}

};


Give it a try and see how it goes!

Regards!

Sean

OriginLab Tech.
babia Posted - 12/03/2015 : 01:45:47 AM
Thanks for the quick reply, but i want the area value to be read into a particular column of a workbook.

Suppose i have 100 workbooks and i have to integrated the 2nd col of each workbook and then the area value so obtained should go in the new workbook.

The code that i am using is as:
Doc -ef W {
integ1 iy:=(Col(1), Col(2)); // integrate col 2 wrt col 1
};
newbook name:="Average Current" sheet:=1;
Col(1)[L]$="Frequency";
Col(2)[L]$="Area";
Col(3)[L]$="Abs(Area)";
Col(4)[L]$="Time";
Col(5)[L]$="Average";
Col(6)[L]$="Normalized";
Col(1)[U]$="Hz";

wautosize; // auto size the col width

col(1)={100,500,1000,5000,10000,20000,40000,50000,70000,90000,100000,120000,150000,200000};//Frequency

col(4)={0.02,0.004,0.002,4E-4,2E-4,1E-4,5E-5,4E-5,2.858E-5,2.22E-5,2E-5,1.666E-5,1.332E-5,1E-5};//Time

csetvalue col:=[ Average Current]Sheet1!col(3) formula:="abs(col(2))" recalculate:=1;
csetvalue col:=[ Average Current]Sheet1!col(5) formula:=" col(3)/col(4)" recalculate:=1;
csetvalue col:=[ Average Current]Sheet1!col(6) formula:=" col(3)/1e-12" recalculate:=1;

wautosize;

// plot Average current vs Frequency

plotxy iy:= [Average Current]Sheet1!(1,5) ogl:=[<new template:="C:\Users\Babia-pc\Documents\OriginLab\91\User Files\AVERAGE_AVE.otp" name:=samplegraph>];
page.longname$="Average current Vs Frequency"; // change the graph name.

layer -a;



I hope that the problem is clear.

SeanMao Posted - 12/03/2015 : 01:25:33 AM
Hi,

You can output the area to a variable and use it later on:


integ1 iy:=(Col(1), Col(2)) area:=area;
area=; // Shows the area value


Regards!

Sean

OriginLab Tech.
babia Posted - 12/03/2015 : 12:21:58 AM
Hi ALL,
Is there any way to read the result log.


Thanks and regards,
Rajesh Agarwal
babia Posted - 12/02/2015 : 02:39:26 AM
Thanks ,

But now i want to read data (area) of the result log into a separate sheet for all the integration.

Thanks in advance.

Regards,
Babia
jasonzhao Posted - 11/30/2015 : 04:55:45 AM
Hello,

You can use the X function Integ1 to calculate the integral
http://www.originlab.com/doc/X-Function/ref/Integ1

and use doc command in LabTalk to loop through your books/sheets
http://www.originlab.com/doc/LabTalk/guide/Flow-of-Control#Doc_-e



Best regards!
Jason
OriginLab Technical Service
babia Posted - 11/29/2015 : 11:59:24 PM
Need help urgently..

Thanks in advance

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