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
 Normalizing (x,y) data after import
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

LDurand

France
3 Posts

Posted - 01/18/2015 :  10:32:51 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello everyone,

I have a lot of files containing two columns (x,y). I would like to write a script at that at the end of the importation, to do the following:

- Find the maximum y value, ymax, in the interval [x1,x2].
- Divide all the y values by y max

I am a newcomer to origin and I would greatly appreciate any help and hints.

Thanks a lot

Origin Ver. : 8.5
Operating System: Win 7

Shirley_GZ

China
Posts

Posted - 01/18/2015 :  10:00:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Please try the below script lines:

double x1 = 3, x2 = 10;
range rr = 2[x$(x1):$(x2)]; //specify XY subrange using X values region
double ymax = max(rr);
col(B) = col(B)/ymax;


Shirley

Originlab Technical Service Team

Edited by - Shirley_GZ on 01/18/2015 10:07:18 PM
Go to Top of Page

LDurand

France
3 Posts

Posted - 01/20/2015 :  12:49:13 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Shirley_GZ

Hi,

Please try the below script lines:

double x1 = 3, x2 = 10;
range rr = 2[x$(x1):$(x2)]; //specify XY subrange using X values region
double ymax = max(rr);
col(B) = col(B)/ymax;


Shirley

Originlab Technical Service Team



Thanks for your help Shirley but it's not working. I don't know why but it does not take the range into account.

Here you have a sample of my data: http://www.filedropper.com/testo_1

With your script, it normalize the data around 0 (the highest value) and I would like it between x = 20 and 25.

Would you mind looking at it again?

Thanks
Go to Top of Page

Shirley_GZ

China
Posts

Posted - 01/20/2015 :  10:49:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Origin 8.5 doesn't support to specify XY subrange using X values region. This feature is available since 8.6.

Please use the bwlo script as a workaround:

int nBegin = index(20, col(A), 2);
int nEnd = index(25, col(A), 1);
range rr = 2[$(nBegin):$(nEnd)]; 
double ymax = max(rr);
col(B) = col(B)/ymax;


Thanks,
Shirley



Originlab Technical Service Team
Go to Top of Page

tingqueji

Afghanistan
3 Posts

Posted - 01/21/2015 :  02:36:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
With your script, it normalize the data around 0 (the highest value) and I would like it between x = 20 and 25.

Would you mind looking at it again?


Go to Top of Page

Shirley_GZ

China
Posts

Posted - 01/22/2015 :  12:46:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please see the answer I posted above

Originlab Technical Service Team
Go to Top of Page

LDurand

France
3 Posts

Posted - 01/25/2015 :  3:08:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Shirley_GZ

Please see the answer I posted above

Originlab Technical Service Team



Disregard this message it is coming from a spambot I think.

Anyway, thanks for your answer, your last suggestion works!
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