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
 X-function: vfind
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bo_liubo

China
13 Posts

Posted - 05/21/2015 :  07:28:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8.6
Operating System: win7
Hi,
I am in trouble with the use of vfind x-function,which seems does not work in my dataset. I want to find the maximum value of the second column below. My command is: vfind ix:=col(2) value:=max(col(2)) ox:=col(3);. But I failed to find out the maximum. The new column named "Indices of Found Values" is blank. what's wrong?

-10.0087 -3.29612E-5
-9.9165 -3.11433E-5
-9.8299 -2.95041E-5
-9.6969 -3.21267E-5
-9.599 -3.33561E-5
-9.4986 -3.21863E-5
-9.364 -3.11358E-5
-9.2625 -2.92806E-5
-9.1255 -3.03535E-5
-9.0254 -3.09644E-5
-8.9296 -3.01151E-5
-8.8286 -3.46227E-5
-8.7003 -3.15456E-5
-8.5969 -3.18883E-5
-8.5032 -3.16052E-5
-8.374 -3.30879E-5
-8.2667 -3.14264E-5

Castiel

343 Posts

Posted - 05/21/2015 :  08:35:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Your script is ok in Origin 2015. Maybe in Origin 8.6 it should be value:=$(max(col(2)))?

妾+   午旦  妹罕妾  妾伊    用仇  妾/     岫ㄞ
 妾京用 仍巨  件 侈   件戶' 甘岫平   /欠  白岫妹
   併             艮          岫  奈 白   岫
                              岫
Go to Top of Page

bo_liubo

China
13 Posts

Posted - 05/22/2015 :  01:12:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I tried your method but I still can not find out the specific data. I used the command "vfind ix:=col(2) value:=max(col(2)) ox:=col(3);" in originlab 2015 and it woks for some simple dataset, such as: 1,2,3,4,...10. I can get the specific value. However, it got a blank column named "Indices of Found Values" for the following dataset:
-7.2898 -3.04278E-5
-7.1427 -3.23054E-5
-6.9564 -3.22458E-5
-6.7626 -3.07557E-5
-6.5724 -3.02192E-5
-6.4067 -3.00702E-5
-6.2308 -3.11133E-5
-6.0646 -3.03384E-5
-5.8755 -3.18285E-5
-5.6823 -3.14709E-5
-5.4924 -2.99212E-5
-5.3372 -3.07259E-5
-5.1374 -3.16497E-5
-4.9736 -3.23948E-5
-4.7755 -3.09345E-5
-4.584 -2.90867E-5
Go to Top of Page

Shirley_GZ

China
Posts

Posted - 05/22/2015 :  04:28:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Would you please check if the second column has been set to Text(align left)? If so, please set it to Numeric in the Column Properties dialog which can be opened by right-clicking to select Properties from the context menu.



Shirley


Originlab Technical Service Team
Go to Top of Page

bo_liubo

China
13 Posts

Posted - 05/22/2015 :  07:25:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I made the column property the same settings as yours. But It did not work. Did you try my data to check if the command can act on the dataset I provided?
Go to Top of Page

Castiel

343 Posts

Posted - 05/22/2015 :  10:06:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by bo_liubo

I made the column property the same settings as yours. But It did not work. Did you try my data to check if the command can act on the dataset I provided?



Tried in Origin 2015, again. It does work. You may try to debug.
1. Run this LabTalk script in Script Window: vfind -e. This will open the X-Function Builder.
2. Click the 4th button in the toolbar, which open the Coder Builder
3. Set a breakpoint inside void vfind()
4. Run the LabTalk script in Script Window:
vfind ix:=col(2) value:=max(col(2)) ox:=col(3)
5. Step over, line by line till the end, in the Code Builder, and see what's ix, value, ox, and tol in the Variables window.

You may also check the properties of col(3). Now show your screenshot.





妾+   午旦  妹罕妾  妾伊    用仇  妾/     岫ㄞ
 妾京用 仍巨  件 侈   件戶' 甘岫平   /欠  白岫妹
   併             艮          岫  奈 白   岫
                              岫
Go to Top of Page

lkb0221

China
497 Posts

Posted - 05/22/2015 :  10:22:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Bo

I tried in 8.6SR3, but cannot reproduce this issue.
If you are just looking for the peak position, you can try list function as workaround.

Zheng
OriginLab
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