Need a book? Engineering books recommendations...

Return to index: [Subject] [Thread] [Date] [Author]

Re: Random Numbers Generator

[Subject Prev][Subject Next][Thread Prev][Thread Next]
In a spreadsheet format create as many @RAND cells as you wish.

Multiply each cell by 10 to obtain numbers greater than 1.0   i.e.  @RAND*10 

If you want to keep your numbers between (say) 5 and 34, the next line of 
equations under, over or next to the each @RAND cell must say as follows:

Example: If @RAND*10 was created in cell A1, in cell right below, A2 (or one 
to the right, B1, or wherever) you must say: 

                   @if(A1<5,0,A1),@if(A1>34,0,A1))

All cells containing numbers smaller than 5 and greater than 34 will display 
0 (zero).

The same results can be achieved by saying:

                  @if(A1<5#OR#A1>34,0,A1)

By pressing F9 you'll get a new set of numbers satisfing this condition.

Same working principle applies to Mathcad.