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
 operations with Worksheets

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
ticofiz Posted - 12/08/2016 : 11:52:00 PM
Origin Ver. 9.1 and Service Release 3
Operating System:MS W7

Hello,

I try to subtract one Worksheet from another, both Worksheets being in the same Workbook. Could you please tell me the syntax to do that? I have found one similar topic in this forum but it is not clear for me how to do that.Here is the link to the data I am trying to analyze https://www.dropbox.com/s/kyvfzv1s1t41ut8/A1.ogw?dl=0.

Many thanks,
Constantin
8   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 12/12/2016 : 5:13:42 PM
Hi Constantin,

> make the operation "find peaks" a bit faster?

May or may not speed up(or even possibly slower), but could you please just experiment to run the Quick Peaks
gadget such that - Make plots from all columns, open Quick Peaks, expand full X range (there is a shortcut for it),
then choose "New Output for All Curves" flyout.

Let me know the result of this experiment.

--Hideo Fujii
OriginLab
ticofiz Posted - 12/12/2016 : 2:59:09 PM
Thank you, Hideo, for the code. Very useful. Do you know something similar that make the operation "find peaks" a bit faster? Currently it take around 90 minutes to analyze a worksheet with 2200 columns and 150 rows. I use "Batch Peak Analysis Using Theme".

Thanks,
Constantin
Hideo Fujii Posted - 12/12/2016 : 2:36:32 PM
Hi Constantin,

In Origin, the most optimized internal code could be achieved by using the unary assignment operator "-=".
In my experiment, this way is 14 times faster than your code with vmathtool x-function. See the sample result below:
/////////////////////////////////////////////
int colnum = wks.ncols;
for ( ii = 1; ii <= colnum; ii++) 	{
  vmathtool -r 2 ix1:=[Book1]1!wcol(ii) operator:=sub operand:=data ix2:=[Book1]2!wcol(ii) ox:=[Results]<active>!<new>;
}
//==> Lap Time = 4.165sec
/////////////////////////////////////////////
for ( ii = 1; ii <= colnum; ii++) 	{
  range r1=[Book1]1!wcol(ii);
  range r2=[Book1]2!wcol(ii);
  range r3=[Book1]3!wcol(ii);
  r3=r2-r1;
}
//==> Lap Time = 1.857sec
//==> 2.2 times faster than using vmathtool
/////////////////////////////////////////////
for ( ii = 1; ii <= colnum; ii++) 	{
  range r1=[Book2]1!wcol(ii);
  range r2=[Book2]2!wcol(ii);
  r2-=r1;
}
//==> Lap Time = 0.296sec
//==> 14 times faster than using vmathtool
/////////////////////////////////////////////

Hope this helps.

--Hideo Fujii
OriginLab
ticofiz Posted - 12/10/2016 : 4:58:30 PM
Thank you for your help. It is much simpler the method you showed. But it is still very slow. The same operation done in Python or Matlab takes 1-2 seconds compared with 10+ minutes for Originlab.

Thanks,
Constantin
AmandaLu Posted - 12/09/2016 : 03:45:56 AM
Could you please refresh this post? I updated the image.

Thanks,
Amanda
OriginLab Technical Service
ticofiz Posted - 12/09/2016 : 03:36:54 AM
Sorry Amanda, I cannot see the code that you posted.
ticofiz Posted - 12/09/2016 : 03:34:21 AM
I have managed to find something like this:
int colnum = wks.ncols; // Number of columns for calculation
	for ( ii = 1; ii <= colnum; ii++)
	{
		vmathtool -r 2 ix1:=[s]1!wcol(ii) operator:=sub operand:=data ix2:=[s]2!wcol(ii) ox:=[Results]<active>!<new>;
			}


But for some reason it is very slow. It has been more than 6 minutes and it hasn't finished yet. I have 100's of sheets to analyze, any idea how to speed things up?

Thanks,
Constantin
AmandaLu Posted - 12/09/2016 : 03:33:03 AM
Hi,

I cannot download your data. But I suppose you want to subtract columns in sheet2 with the corresponding columns in sheet1? Please try highlight all columns in worksheet 3, right click and select Set Multiple Column Values. In the dialog that opens, set formula as follow:



Thanks,
Amanda
OriginLab Technical Service

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