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 for Programming
 LabTalk Forum
 Normalising the data

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
Marin Vojkovic Posted - 10/30/2013 : 09:36:18 AM
Origin Ver. and Service Release (Select Help-->About Origin): v7.0552(B552)
Operating System: Windows XP

How to divide all the columns in a worksheet by the max value of each column?
This is what I have so far:

win -a LID; //make the worksheet active

loop(ii, 2, 45) //looping trough columns
{

mc=max(wcol(ii)); // max of the column

LIDnorm_[ii] = wcol(ii)/mc; //this is the part I'm unsure of...
}

so, how do I get it to write the new data to columns on the new worksheet (LIDnorm)?

Thank you in advance for any help with this.
3   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 10/31/2013 : 09:11:07 AM
This should do it:

loop(ii,2,wks.ncols)
{
sum(wcol(ii));
dMax = sum.max;
wo -s ii 0 ii 0;
%C/dMax;
}
Marin Vojkovic Posted - 10/30/2013 : 10:15:49 AM
nope...
it just puts 1 everywhere, except in the cells where the value was 0 - it makes them blank.

I would like 0 to stay 0, and everything else in the column to be divided by the max of the column.

greg Posted - 10/30/2013 : 09:48:55 AM
This works in most versions of Origin:

loop(ii,2,wks.ncols)
{
wcol(ii) /= max(wcol(ii));
}

Not sure about version 7's handling of vector division ..

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