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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Random Combination Generator from two Integer Filled Vectors?

dsochor
10-Marble

Random Combination Generator from two Integer Filled Vectors?

Is there a built in function in MathCAD prime that can create pair combinations of integers from two dissimilar length vectors filled with integers? 

3 REPLIES 3

Mathcad has a random number generator, there has been a fair amount of discussion over the years about how random it really is.

 

I don't know of a built-in function that would do what you want; but using the random number generator to create random indices into each vector shouldn't be terribly difficult.

LucMeekes
23-Emerald III
(To:dsochor)

As Fred indicated, there isn't a built-in function, but it's easy to create one, if you trust the built-in random number generators:

LM_20171219_RandomPick.png

I've take that both arrays are the same length, so they can be columns of the same matrix.

I'm also assuming that you want numbers from different rows...

 

Success!
Luc

Werner_E
25-Diamond I
(To:dsochor)

Here is my approach with a function with two vector arguments which can be of different size:

Bild.png

Announcements

Top Tags