T O P I C R E V I E W |
titties |
Posted - 02/27/2011 : 06:21:37 AM 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 |
4 L A T E S T R E P L I E S (Newest First) |
titties |
Posted - 03/02/2011 : 07:32:12 AM Thanks AmandaLu,
I will look into some scripting with your piece of code as starting point :)
Kind Regards |
AmandaLu |
Posted - 02/28/2011 : 9:30:11 PM 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
|
titties |
Posted - 02/28/2011 : 11:07:45 AM 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 |
AmandaLu |
Posted - 02/28/2011 : 05:58:59 AM 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.
|
|
|