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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

rnd (-1,+1)?

payman
14-Alexandrite

rnd (-1,+1)?

Hello,

How can I use "rnd" function to generate random numbers between [-1,1] rather than [0,1] ?

Thank you.

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:payman)

rnd(2) -1

You may use a selfdefined function rand(a,b):=a + rnd(b-a)

If you need a vector of more values you may use runif(100,-1,1)

View solution in original post

2 REPLIES 2
Werner_E
25-Diamond I
(To:payman)

rnd(2) -1

You may use a selfdefined function rand(a,b):=a + rnd(b-a)

If you need a vector of more values you may use runif(100,-1,1)

payman
14-Alexandrite
(To:Werner_E)

Thank you.

Announcements

Top Tags