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
 LabTalk Forum
 Integration of coloumn
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

babia

India
11 Posts

Posted - 11/27/2015 :  02:18:05 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

babia

India
11 Posts

Posted - 11/29/2015 :  11:59:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Need help urgently..

Thanks in advance
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 11/30/2015 :  04:55:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

babia

India
11 Posts

Posted - 12/02/2015 :  02:39:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

babia

India
11 Posts

Posted - 12/03/2015 :  12:21:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi ALL,
Is there any way to read the result log.


Thanks and regards,
Rajesh Agarwal
Go to Top of Page

SeanMao

China
288 Posts

Posted - 12/03/2015 :  01:25:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

babia

India
11 Posts

Posted - 12/03/2015 :  01:45:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.

Go to Top of Page

SeanMao

China
288 Posts

Posted - 12/03/2015 :  03:45:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

babia

India
11 Posts

Posted - 12/03/2015 :  05:35:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Perfect.

Thanks a lot.

Regards,
Rajesh Agarwal
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