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
 changing multiple column values

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
JGottesman Posted - 10/17/2000 : 3:53:00 PM
I'd like to be able to rescale column data globally for an entire worksheet using a single scaling value. As far as I can tell, I can only do this on a column by column basis, which is inefficient in the extreme.
Prism can perform any math transform on one, selected or all columns in any worksheet. Have I missed some easy way to do this in Origin 6.0? If not, it really should be implemented.
7   L A T E S T    R E P L I E S    (Newest First)
Jose Posted - 10/25/2000 : 8:31:00 PM
Lorraine,

you second script, doc -e D {%C*(-8);};, is what I was looking for; but the Origin Manual sais that that -e D option for the document command works for "data plot in the active layer", and I did not expect it to work with a worksheet. After your suggestion I tried it, and it does! So my previous ideas using -e S, restricting it to a worksheet with an if condition, are not really necessary.

j.

P.S. This is not the first time that I find something of this kind: a bad description of a command or an option in the Origin Manual/Help File. If this -e D option, for instance, makes the command act over both worksheets and plots, it should be specified. Otherwise the user begins to think on how to combine the other options to get what he/she wants, as it was my case...

[This message has been edited by Jose (edited 10-26-2000).]

Jose Posted - 10/24/2000 : 12:30:00 PM
Just for completion, the following script normalizes every dataset in the worksheet 'Data1' to its correspondant maximum value:


doc -e s {

if (%[%C,'_']=="Data1") {

sum(%c);
type Maximum of %c: $(sum.max);
"%c"=%c/sum.max;

}
}

j.

JGottesman Posted - 10/24/2000 : 8:58:00 PM
Thanks to both Lorraine and Jose. Good script solutions that I can use. Much appreciated!

Jon

Jose Posted - 10/24/2000 : 8:55:00 PM
I haven't check this, but it should work. The following script

doc -e s { "%c"=2*%c; };

should double the value of every dataset in the current project (not only one worksheet). See the Origin Manual or help file to read about this 'document' command.

This is not exactly what you want, but can help.

j.


P.S. Well, I have check it now, and it works :-)

Jose Posted - 10/24/2000 : 8:01:00 PM
Using the previous idea, you can apply your function to a single worksheet by typing, for instance,


doc -e s {

if (%[%C,'_']=="Data1") {"%c"=2*%c;};

}

This will execute your doubling routine only over the datasets of the worksheet 'Data1'.

j.

Lorraine Posted - 10/24/2000 : 1:13:00 PM
Here's another script that cycles through the worksheet and multiplies the entire numeric content by -8. These two forms of script accomplish the same task:


test=wks.ncols;

loop(ii,1,test){
%(%H,ii)=-8*%(%H,ii);
}


doc -e D {%C*(-8);};

Lorraine Posted - 10/23/2000 : 5:14:00 PM
I hope I understand your question correctly. If you would like to run a mathematical function across columns in a worksheet you might want to bypass the Set Column Values function and just create a button instead. This button can be attached to the worksheet template, or as a user defined tool.

So say for example you placed a button on the worksheet, your associated script can follow this simple example (assuming the worksheet in question is the active worksheet):



col(5)=col(3)/col(4);

col(temp)=col(temp2)*col(temp3);

or including other worksheets...

col(4)=data1_b*col(1);

Here's another example using the document command:


doc -e D {%C/=100;};

Information on creating buttons can be found on page 714 of the Origin 6.0 User's manual. Information on User defined toolbar buttons can be found on page 722 of the Origin 6.0 User's Manual.

[This message has been edited by Lorraine (edited 10-24-2000).]


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