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
 check if column exists for averaging
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

juannim

USA
Posts

Posted - 10/30/2007 :  6:21:06 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System:xp
I have 51 columns of data, from three replicates of 17 measurements. Columns are named as such:
290a 290b 290c 300a 300b 300c 310a 310b 310c

In some cases, however, one of the letters might be missing- e.g.
290a 290b 290c 300b 300c

I need to average all of the 290 columns, all of the 300's, etc.
How can I check to see if a column exists to modify the averaging loop to move on if there is a missing column? Jonathan

Mike Buess

USA
3037 Posts

Posted - 10/30/2007 :  8:44:43 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Use LabTalk's exist() function...

if( exist(Data1_290c,1)>0 ) {column 290c exists in worksheet Data1 so do something};
else {it does not exist so skip};

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 10/30/2007 9:20:31 PM
Go to Top of Page

juannim

USA
Posts

Posted - 10/31/2007 :  09:27:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Mike,
Thanks for your help, as usual. What is the meaning of the >0 in the script? Thanks. Jonathan
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 10/31/2007 :  12:47:18 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
What is the meaning of the >0 in the script?
>0 means greater than zero.

As written, the value of exist() function returns zero if dataset Data1_290c does not exist. If dataset exists the function returns a positive value that depends on if and how it's plotted.

Mike Buess
Origin WebRing Member
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