MATLAB Answers

How can I compute a point-by-point difference between a RAND and RANDN matrix?

2 ビュー (過去 30 日間)
DO
DO 2019 年 11 月 26 日
Commented: Rena Berman 2019 年 12 月 12 日
I need to write a program that:
a) seeds the RAND and RANDN random number generators to a random position
b) generates two 100 x 100 matrices of random numbers, one using RAND and one using RANDN
c) resets the random number generator to the state it was in before generating the matrices
d) generates two more 100 x 100 matrices, one with RAND and one with RANDN
e) computes the point-by-point difference between the first and second matrix generated with each function
f) sums the values in each difference matrix
How can I do this?

  4 件のコメント

表示 1 件の古いコメント
Guillaume
Guillaume 2019 年 11 月 26 日
Note that we really don't like people who edit their question away, particularly if we spend time helping you.
I've asked mathworks to restore your original question.
Image Analyst
Image Analyst 2019 年 11 月 27 日
A HUGE proportion of people who have only one post end up deleting them. It's getting so bad that I'm tempted to check the poster first, and if it's their first post to just copy it in a comment.
Rena Berman
Rena Berman 2019 年 12 月 12 日
(Answers Dev) Restored edit

サインイン to comment.

件の回答 (1)

Guillaume
Guillaume 2019 年 11 月 26 日
"I honestly don't even know where to start, my instructor never went over what "seed" means"
Have you tried searching matlab's doc for seed? The first result returned has all the information you'd want to know about seed and more.
Your code is indeed correct, the only thing you need to do is reset the seed. Indeed there should not be any difference between the two sets. If there was, there would be something seriously wrong with matlab.

  0 件のコメント

サインイン to comment.

サインイン してこの質問に回答します。


Translated by