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
Normalising the data
New Topic
Reply to Topic
Printer Friendly
Author
Topic
Marin Vojkovic
Croatia
7 Posts
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.
greg
USA
1379 Posts
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 ..
Edited by - greg on 10/30/2013 09:49:10 AM
Marin Vojkovic
Croatia
7 Posts
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
USA
1379 Posts
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;
}
Topic
New Topic
Reply to Topic
Printer Friendly
Jump To:
Select Forum
Origin Forum
Origin Forum
Origin Viewer Forum
Origin Forum for Programming
Forum for Python
LabTalk Forum
Forum for Origin C
Forum for Automation Server/COM and LabVIEW
Origin中文论坛
Origin 中文论坛 (Chinese Origin Forum)
Japanese Origin Forum
Origin日本語フォーラム (Japanese Origin Forum)
Origin on Linux
The Origin on Linux Forum
Private Forums
Distributor Forum
--------------------
Home
Active Topics
Frequently Asked Questions
Member Information
Search Page
The Origin Forum
© 2020 Originlab Corporation
Snitz Forums 2000