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
 Delete last column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hkkim

Republic of Korea
35 Posts

Posted - 01/11/2013 :  03:22:48 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8.1 SR3
Operating System: Windows XP

Hello!

I want to get an integral area ratio between two graphs. But I don't want to add these integrated columns to a worksheet.

1. I tried to remove these columns using 'x2' variable but did not work(<== in below code). Why?
2. If you have a better way to implement this function please let me know it.
3. If the numbers of two columns are not same I want to integrate until the smaller one. Is there any good way for it?

Thank you so much. Have a nice weekend!

hkkim

--------------------------------------------------------------------------------------
integ1 iy:=col(2) type:=abs plot:=0 area:=0;
area1=integ1.area;
area1=;
integ1 iy:=col(4) type:=abs plot:=0 area:=0;
area2=integ1.area;
area2=;
area2/area1=;

AREA1=1034.721
AREA2=1055.41542
AREA2/AREA1=1.02

x2=;
X2=6
del col(x2);
#Command Error! <== ??

del col(6);
del col(5);

greg

USA
1378 Posts

Posted - 01/11/2013 :  2:59:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
To answer the question posed by your topic ...

del wcol(wks.ncols); // Deletes the last column
del wcol(x2); // This deletes the LAST VISIBLE COLUMN IN YOUR WORKSHEET (so do not use it)

The COL( ) function expects a column name or a number and 'X2' is neither. The WCOL( ) function I used above always expects a number so when it encounters something that is not a number, it assumes it is a variable that must be interpreted to get the number.

Here is a variant that uses COL( ) along with wks.ncols property:

del col($(wks.ncols));
Go to Top of Page

hkkim

Republic of Korea
35 Posts

Posted - 01/14/2013 :  12:48:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Greg!

I have resolved all my questions with your help. Thank you so much!
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