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

generating random elements

payman
13-Aquamarine

generating random elements

Hello All,

Could anybody help me with this question please?

I have a matrix "M" with five elements. I want to generate 10 (for example) matrices such that each element is randomly within +/- %5 of the corresponding element of the matrix "M".

Thank you in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby IV
(To:payman)

PAYMAN RAJAI wrote:

Hello All,

Could anybody help me with this question please?

I have a matrix "M" with five elements. I want to generate 10 (for example) matrices such that each element is randomly within +/- %5 of the corresponding element of the matrix "M".

Thank you in advance

You may use something like this for a single value or matrix

1.png

You may also turn this procedure in a function

2.png

and use this function to create ten sets using a range variable

3.png

View solution in original post

6 REPLIES 6
Fred_Kohlhepp
23-Emerald I
(To:payman)

One simple way:

payman
13-Aquamarine
(To:Fred_Kohlhepp)

Thank you very much Fred.

I can't open the file. Would you please send the file in Mathcad15?

VladimirN
23-Emerald II
(To:payman)

Please find in attachment version of this document in PDF format.

Werner_E
24-Ruby IV
(To:payman)

PAYMAN RAJAI wrote:

Hello All,

Could anybody help me with this question please?

I have a matrix "M" with five elements. I want to generate 10 (for example) matrices such that each element is randomly within +/- %5 of the corresponding element of the matrix "M".

Thank you in advance

You may use something like this for a single value or matrix

1.png

You may also turn this procedure in a function

2.png

and use this function to create ten sets using a range variable

3.png

View solution in original post

StuartBruff
20-Turquoise
(To:Werner_E)

Nice and Simple, Werner! The hallmark of a Good Worksheet 🙂

I'm too lazy to type out the range variable, though ...

Stuart

collab+-+15+01+08+random+variations+01.JPG

payman
13-Aquamarine
(To:payman)

Thank you very much Werenr and Stuart. A great help

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."