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
 "set column values.." for multiple columns in 1 go
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

titties

Anguilla
Posts

Posted - 02/27/2011 :  06:21:37 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8.5
Operating System: Win7, 64 bit

Dear All,

I have a lot of spectra (y-columns) that are plotted against the same X-column dataset. For each Y-column I want to subtract the value at a given x-value (.ie. subtract column y1 with the value of column y1 at X = 1000, and then subtract the column y2 with the value of column y2 at X = 1000, etc. etc.).

I can do this manually by using the "set column values" for each column by writing e.g.: Col(B)-value at X = 1000, where the value at X=1000 is selected and copy-pasted, which is a bit tedious.

I then figured out to simplify this a bit, and for each column I now enter:

wcol(_ThisColNum)-wcol(_ThisColNum)[24]

, where [24] specifies the row number that corresponds to my X = 1000.

This is good, but I still have to copy-paste the above code into "set column values" for each column.

My question now is: Can this be done in a simpler way to apply this to all the columns in one step?


Thank for any response.

Kind Regards,
Tissie

AmandaLu

439 Posts

Posted - 02/28/2011 :  05:58:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi titties,

To set all columns values at one time, you need to write LabTalk scripts to loop this formula.

Or you can save this formula by select Formula: Save As in the Set Column Values dialog. Then click >> button to go to the next column. Then select the formula you saved under Formula menu to load it. This may alleviate the work a little bit, but cannot set all columns value in one time.

Go to Top of Page

titties

Anguilla
Posts

Posted - 02/28/2011 :  11:07:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply

Hi AmandaLu,

Thank you for your response. Ok, your 2nd option is slightly more refined than my copy-pasting, so I think i'll go with that method, which is faster than me beginning to figure out how to write a script, as I am not much of a programmer.. hehe.

Thanks,
Tissie
Go to Top of Page

AmandaLu

439 Posts

Posted - 02/28/2011 :  9:30:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi titties,

In fact, it is not so much difficult to learn LabTalk. I just write an example for you to begin with

loop(ii, 2, wks.ncols)
{col($(ii))-=cell(24,$(ii));} //substract row 24 for col(2) to the end

Edited by - AmandaLu on 02/28/2011 10:37:16 PM
Go to Top of Page

titties

Anguilla
Posts

Posted - 03/02/2011 :  07:32:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks AmandaLu,


I will look into some scripting with your piece of code as starting point :)

Kind Regards
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