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
 Even spacing fluctuation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Khosrove

Latvia
12 Posts

Posted - 12/02/2015 :  11:07:44 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Is there a way to get the even spacing fluctuation value when converting from worksheet to matrix? I understand that it won't go through with the conversion if the set tolerance is lower than the even spacing fluctuation, but I would like to know the value of fluctuation if it is lower than the tolerance limit and does go through.

SeanMao

China
288 Posts

Posted - 12/02/2015 :  10:23:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I am not sure what is the fluctuation value you mentioned. You may find some reference about the criteria we used in gridding for converting worksheet to matrix:

http://www.originlab.com/doc/Origin-Help/XYZGridding-Dialog

Regards!

Sean

OriginLab Tech.
Go to Top of Page

Khosrove

Latvia
12 Posts

Posted - 12/03/2015 :  1:11:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
SeanMao,

thank you for your reply. However that isn't exactly what I meant.
When converting a worksheet to matrix using direct conversion, there is an option to set Even Spacing Tolerance(%)
If the set tolerance is lower then a message pops up saying for example
"Your X data are not evenly spaced, it has fluctuation of 12.35%.
Please try changing the tolerance setting."


I would like to obtain the fluctuation percentage even when there is no error message and the worksheet is converted to a matrix without problems (when the set percentage is higher that the fluctuation percentage). Hope this clears up my problem.
Go to Top of Page

SeanMao

China
288 Posts

Posted - 12/03/2015 :  9:55:30 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I checked into the code of our w2m X function and extract the code that is used to calculate the fluctuation percentage.

You may need to define a function as I show below to obtain this value separately:


double fluc(vector& vxy, double dTolPerc)
{
	vector vdiff;
	double dFluctPerc;
	vxy.Difference(vdiff);
	double min, max;
	vdiff.GetMinMax(min, max);
	double dMean;
	vdiff.Sum(dMean);
	dMean = dMean/(1.0*vdiff.GetSize());
	dFluctPerc = round(fabs(max - dMean)/fabs(dMean)*100, 2);
	return dFluctPerc;
}


To use it, suppose col(A) is your Y values col, you can run:
flucpercent = fluc(col(A),5) // where 5 is the tolerance you input

Regards!

Sean

OriginLab Tech.

Edited by - SeanMao on 12/03/2015 9:56:56 PM
Go to Top of Page

Khosrove

Latvia
12 Posts

Posted - 12/04/2015 :  03:29:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you! I haven't tried this yet, but this is what I was looking for. Never would have found it on my own, thanks!
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