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 for Programming
 LabTalk Forum
 calculating with different 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
abreiti Posted - 11/29/2006 : 06:01:56 AM
Hello!

I want to calculate the sum of every point of a layer with different datasets:
1. I count all datasets
2. I build a new worksheet
3. I build a for-loop over all datasets
4. I want to add all datasets to column 1

Here's my LabTalk-Script - that doesn't work:

layer -c; //count all datasets
win -t wks; //new worksheet
for (ii=1;ii<=count;ii++)
{
col(1) = col(1) + %[%z,#$(ii)];
};

Maybe somebody can help.

1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 11/29/2006 : 07:24:25 AM
It doesn't work because col(1) has no values to begin with and adding anything to a missing value yields a missing value. Try this...

layer -c; //count all datasets
win -t wks; //new worksheet;
col(1)=%[%Z,#1];
for (ii=2;ii<=count;ii++)
{
col(1) = col(1) + %[%z,#ii];
};

Mike Buess
Origin WebRing Member

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