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
 LabTalk scripts for integration and plotting
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

krpaudel

USA
1 Posts

Posted - 11/08/2013 :  9:02:42 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello all,
I am still struggling in programming.
I wanted to subtract second column from rest of the 300 columns in a worksheet, then integrate each columns and then plot one graph with the values of integrals on y-axis and numbers from 1 to 300 in order on x axis.
Would anyone please help me in this?

K.Paudel

greg

USA
1379 Posts

Posted - 11/11/2013 :  11:49:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This should do it:

%N = %H; // Remember our worksheet
newbook name:=Integrations sheet:=1 option:=lsname; // Create result book
range raX = 1; // Result index
range raY = 2; // Result area
win -a %N; // Go back to our data
// Fow all columns beyond 2
loop(ii,3,wks.ncols)
{
wcol(ii)-=col(2); // subtract column 2
integ wcol(ii); // integrate
raX[ii-2] = ii-2; // Fill in X
raY[ii-2] = integ.area; // Fill in Y
}
plotxy (rax,ray) plot:=201; // plot
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