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

abreiti

Germany
Posts

Posted - 08/05/2008 :  10:29:48 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I have a problem with the following for-loop. The gain is, to divide the dataset in 5 area with equal size and identify the min and max-data in evrey area. Maybe someone knows another solution.

Thanks,

abreiti

Code:

%h; //current dataset
kk=801;
nn=0;
mm=0;
b=0;
c=0;
for (pp=1;pp<=5;pp++)
{
mm=(kk/5*pp);
mm=nint($(mm));
limit %h_Hoehe -b $(nn) -e $(mm);
b = $(limit.ymax);
c = $(limit.ymin);
rz$(pp) = b - c;
nn=mm+1;
};

adamleewiner

China
Posts

Posted - 08/05/2008 :  3:32:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I think kk is a scalar with 'kk=801' rather than a dataset; %h contains the name of the active workbook.

An USTCer always keep trying.

Edited by - adamleewiner on 08/05/2008 3:33:22 PM
Go to Top of Page

greg

USA
1380 Posts

Posted - 08/12/2008 :  1:04:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Corrections:

// %h; Does not do anything - %H contains active page name
// kk = 801; Instead, use the following
get %H_Hoehe -e kk;
nn = 1; // ranges start with 1
mm = 0;
b = 0;
c = 0;
for ( pp = 1 ; pp <= 5 ; pp++ )
{
mm = (kk / 5 * pp);
mm = nint(mm); // mm is numeric, do not need $(mm)
limit %h_Hoehe -b nn -e mm;
b = $(limit.ymax);
c = $(limit.ymin);
rz$(pp) = b - c;
nn = mm + 1;
}
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