rand command give different answer

mat.jpg
why this rand command give different result

댓글 수: 1

Stephen23
Stephen23 2020년 2월 9일
"why this rand command give different result"
What do you expect its output to be?

댓글을 달려면 로그인하십시오.

답변 (2개)

James Tursa
James Tursa 2020년 2월 9일
편집: James Tursa 2020년 2월 9일

1 개 추천

rand( ) is a random number generator ... it is supposed to give a different result.
doc rand
If you want to start over with the same stream of numbers you will need to re-seed it.

댓글 수: 1

Iqra
Iqra 2023년 1월 6일
beacuse rand function generates value randamly between 0 and 1 interval

댓글을 달려면 로그인하십시오.

Chuguang Pan
Chuguang Pan 2020년 2월 9일

0 개 추천

All the random number functions, rand, randn, randi, and randperm, draw values from a shared random number generator. Every time you start MATLAB, the generator resets itself to the same state.
The rand function draw values from a RandStream.

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

릴리스

R2019a

태그

질문:

2020년 2월 9일

댓글:

2023년 1월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by