cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Random range variable

ptc-5377589
1-Newbie

Random range variable

How can I define a range variable when the variables are not necessarily in defined pattern? I have got round the issue in the attached using a lookup expression from a table but can I not define d as a comma separated list? d:= 12,16,20,24,30,36 ? to simplify the expression?

1 ACCEPTED SOLUTION

Accepted Solutions

OK, this is better, thanks for your help Andy

Capture.JPGr

View solution in original post

5 REPLIES 5

What do you want to do with the range variable once it is created?

the FOR command in the programming toolbar gives a structure:

for <variable> <for each value in> LIST

that will allow you to produce a program as :

Capture.PNG

regards

Andy

Thanks Andy, I've been trying since you posted but I can't see how I actually use that in my programme? In the end I'm trying to avoid using a lookup table and using a for statement similar to yours! Alas my understanding is failing!
Capture.JPG

OK, this is better, thanks for your help Andy

Capture.JPGr

Rather than a lookup table, use a vector.

Fred Kohlhepp wrote:

Rather than a lookup table, use a vector.

Indeed. In this instance, getting the vector should be a straight forward matter of using submatrix to extract it from Table1.

d:=submatrix (Table1, 1, rows (Table1)-1,1,1)

Stuart

Top Tags