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
 Xindex on list of date entries
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

JokerOne

Germany
58 Posts

Posted - 09/14/2016 :  11:58:30 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 9.1 and Service Release 3(Select Help-->About Origin):
Operating System: Win 7

Hello everybody,

I am trying to find the index in a list of date-entries that contains the "largest", i.e. "most current" date.
When I am applying xindex for this task, it fails somehow, see screenshot.
Applying xindex on the corresponding Julian date number works as intended.

Is there a method, that avoids the second col to be created? Thanks

JokerOne

Germany
58 Posts

Posted - 09/15/2016 :  03:12:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok,Ok.

From the docs:

http://www.originlab.de/doc/LabTalk/ref/Xindex-func

vd must be a designated Y dataset.
The Y dataset name must correspond to an actual Y dataset.
The associated X dataset must be sorted in ascending order.

Missed that..., sorry.
Go to Top of Page

JokerOne

Germany
58 Posts

Posted - 09/15/2016 :  04:35:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Just for the protocol:

What seems to be a possible solution for the original task is:

range aaa = col(a);
maxa = max(aaa);
vfind ix:=aaa value:=maxa ox:=targetindex_dataset;
targetindex = targetindex_dataset[1];

So vfind is the solution her.
Care needs to be taken, when using the output variable targetindex_dataset, as this is a dataset type.

When, e.g.
col(a)[targetindex_dataset] is called, this might yield to errors, while
col(a)[targetindex] should work.
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