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
 comparing complete colums or datasets
 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 - 03/08/2016 :  03:33:57 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 9.1 and Service Release 1(Select Help-->About Origin):
Operating System: Win 7

Is there a particular command to check, if ALL members (cells) of two datasets (colums) are equal.

e.g.:
dataset a = {1:3};
dataset b = {1:3};
c = (a==b);// (??? - expected: c = 1)
b[3] = 4; // Now a != b
c = (a==b);// (??? - expected: c = 0 but results: 1)

Also, imagine the same data put into col(a) and col(b) in a worksheet.
Can I somehow check:
d = (col(a) == col(b)) or such?

I am aware that I could script a (potential? double-) for loop look to check this line-wise, but I would like to know, if there is an easier way.

Thanks!


jasonzhao

China
262 Posts

Posted - 03/08/2016 :  04:39:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

You can sum the relative distance between Column A and Column B in this way:


dd=sum(Distance(0,col(A),0,col(B)));
dd=;

if value dd=0, the column A and column B should be the same.

You can refer to:
http://www.originlab.com/doc/LabTalk/ref/Distance-func


Best regards!
Jason
OriginLab Technical Service

Edited by - jasonzhao on 03/08/2016 04:39:51 AM
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