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
 changing multiple column values
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

JGottesman

Minneapolis, MN USA
2 Posts

Posted - 10/17/2000 :  3:53:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

Lorraine

USA
66 Posts

Posted - 10/23/2000 :  5:14:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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).]

Go to Top of Page

Lorraine

USA
66 Posts

Posted - 10/24/2000 :  1:13:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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);};

Go to Top of Page

Jose

Netherlands
93 Posts

Posted - 10/24/2000 :  8:01:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.

Go to Top of Page

Jose

Netherlands
93 Posts

Posted - 10/24/2000 :  8:55:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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 :-)

Go to Top of Page

JGottesman

Minneapolis, MN USA
2 Posts

Posted - 10/24/2000 :  8:58:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks to both Lorraine and Jose. Good script solutions that I can use. Much appreciated!

Jon

Go to Top of Page

Jose

Netherlands
93 Posts

Posted - 10/24/2000 :  12:30:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.

Go to Top of Page

Jose

Netherlands
93 Posts

Posted - 10/25/2000 :  8:31:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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).]

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