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
 row index in script window
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

usk

Germany
Posts

Posted - 01/29/2007 :  08:23:09 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version : 7.5 pro
Operating System: winXP

Hello everyone!

I am trying to realize "fill column with row numbers" function in the script window. An expression like "col(a)=i" does not work. The "i" is not recognized as a row index.
How should I proceed?

Cheers,
Yurii

Mike Buess

USA
3037 Posts

Posted - 01/29/2007 :  08:36:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Yurii,

You need to loop over the row index: loop(i,1,wks.maxrows) {col(A)[i]=i};

However, this vector assignment is faster: col(A)=data(1,wks.maxrows);

Mike Buess
Origin WebRing Member
Go to Top of Page

usk

Germany
Posts

Posted - 01/29/2007 :  08:46:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Mike!

Of course, I did try loop, but it is rather slow.
Vector assignment is exactly what I was looking for!


Yurii
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