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 for Programming
 LabTalk Forum
 reading the first and last values of a dataset...
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

zskillz

USA
6 Posts

Posted - 10/11/2003 :  9:29:21 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I need to read the first and last values in colA of a data set. the first is simple enough, but how can I read what the last value is if there are more rows in the dataset then there are values in the column...

just to clarify. I have a data set w/ 8 rows...

1
2
3
4
5
[blank]
[blank]
[blank]

and i want to read 1 and 5 and set them to a min and max variable...

alternatively... I know that these values will be the minimum and maximum, respectively, of the data set... however, i cannot seem to find a way to read the "max" or "min" value of a data set..

any ideas are warmly welcomed!

thanks
-Z

cpyang

USA
1407 Posts

Posted - 10/11/2003 :  11:01:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If you just need to get the min/max of a dataset, you can use the Sum function, like


sum(col(a));sum.min=;sum.max=;


CP


Go to Top of Page

Peter.Hors1

Germany
11 Posts

Posted - 10/21/2003 :  10:27:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Without blanks this works (think you know that):
get data1_B -e last; last=;

With blanks this works if you dont have any blank in between:
for (i=1;i<=wks.nrows;i++) {
if(data1_B[i]==) {type found last one in row $(i-1)!; break;}
};



Peter Horstmann
Robert Bosch GmbH
Germany
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