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
 Error!! Failed to initialize range from string
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

mecsumit

2 Posts

Posted - 05/02/2013 :  06:48:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have a matrix data (46*401) in the form of one column, col(1) . I am trying to smooth the data row wise (i.e. in a set of 401 points). So I selected the range with k(start of the range) and m(end of the range) variable, as shown in the code below. But when I am executing the code it gives an error... ¨Failed to initialize range from string, VarName = iy, VarValue = ¨


loop(i, 1, 46)
{
k=401*(i-1)+1;
m=401*i;

smooth iy:=Col(1)[k:m] method:=1 npts:=300 boundary:=1 oy:=Col(2)[k:m]
}

Where is the problem in the code, how can I solve it?

Thanks
-sumit

Origin Ver. and Service Release (Select Help-->About Origin):
Operating System:

cdrozdowski111

USA
247 Posts

Posted - 05/02/2013 :  07:52:10 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Define k and m as:

int k = 401*(i-1)+1;
int m = 401*i;

And see if that helps.

If not then change the range to:

Col(1)[$(k):$(m)]

And see if that helps. I'm not at my computer and can't double check.
Go to Top of Page

mecsumit

2 Posts

Posted - 05/02/2013 :  08:26:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot cdrozdowski. Though, I already tried putting int k, int m before, but that didn't work.
BUT, now putting the $(k), $(m) the code runs like charm.. :-)

You made my work half ;)

Thanks a lot again...

quote:
Originally posted by cdrozdowski111

Define k and m as:

int k = 401*(i-1)+1;
int m = 401*i;

And see if that helps.

If not then change the range to:

Col(1)[$(k):$(m)]

And see if that helps. I'm not at my computer and can't double check.

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