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
 Origin Forum
 Find intersection points of multiple sheets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

mitsous

5 Posts

Posted - 02/09/2016 :  09:50:07 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 9 and Service Release
Operating System: Windows 7 x64

Hello,

I have a workbook with 150 sheets. Each sheet has 2 columns of x and y variables. For each sheet i need to find a unique intersection point with x axis and put this to a new workbook with 1 sheet. So, the final book should have 1 column and 150 lines with each point. Also, because my data are noisy it would be convenient to set a range i.e search for the intersection point between 1.9 and 2.2. I saw that levelcrossing function should do it but after many tries i can't build a working loop. Any ideas?

Thanks,

cpyang

USA
1406 Posts

Posted - 02/10/2016 :  01:32:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The following code assumes input book is Book1 and output into another book named Book2

//assume data in book1 and result in book2
dataset xx;
int ncrossing;
int nout;
range xout=[book2]1!1;

range myBook=[book1];
nout = 1;
for(int ns=1; ns<=myBook.nLayers;ns++)
{
	range mydata=[book1]$(ns)!(1,2);//assume XY
	levelcrossing iy:=mydata nc:=nn oy:=xx;
	if(nn>0) //has at least one crossing, get the first
	{
		xout[nout]=xx[1];
		nout++;
	}
}



give it a try, if does not work, maybe your Origin is too old, try the demo Origin 2016.

CP
Go to Top of Page

mitsous

5 Posts

Posted - 02/12/2016 :  07:27:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for the answer.

Unfortunately this code is not working.


I have Origin 9.0
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 02/13/2016 :  10:55:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please download the demo for the current version and try.

CP
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