Skip to main content
1-Visitor
Jan 7, 2015 8:17 PM UTC
Solved

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

Werner_E
Werner_EAnswer
25-Diamond I
Jan 7, 2015 10:47 PM UTC

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

6 replies

23-Emerald I
Jan 7, 2015 9:04 PM UTC

One simple way:

Translate
payman1-VisitorAuthor
1-Visitor
Jan 7, 2015 9:24 PM UTC

Thank you very much Fred.

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

Translate
24-Ruby IV
Jan 12, 2015 11:44 AM UTC

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

Translate
Werner_E
Werner_E25-Diamond IAnswer
25-Diamond I
Jan 7, 2015 10:47 PM UTC

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

Translate
23-Emerald V
Jan 8, 2015 9:47 AM UTC

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

Translate
payman1-VisitorAuthor
1-Visitor
Jan 8, 2015 4:42 PM UTC

Thank you very much Werenr and Stuart. A great help

Translate