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
 Origin Forum
 Normalizing (x,y) data after import

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
LDurand Posted - 01/18/2015 : 10:32:51 AM
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
6   L A T E S T    R E P L I E S    (Newest First)
LDurand Posted - 01/25/2015 : 3:08:53 PM
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!
Shirley_GZ Posted - 01/22/2015 : 12:46:09 AM
Please see the answer I posted above

Originlab Technical Service Team
tingqueji Posted - 01/21/2015 : 02:36:25 AM
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?


Shirley_GZ Posted - 01/20/2015 : 10:49:29 PM
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
LDurand Posted - 01/20/2015 : 12:49:13 PM
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
Shirley_GZ Posted - 01/18/2015 : 10:00:51 PM
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

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