How to replicate a matlab procedure

조회 수: 2 (최근 30일)
Andrew Poissant
Andrew Poissant 2017년 3월 20일
답변: Roger Stafford 2017년 3월 23일
I currently have a matlab monte carlo simulation that includes multiple for loops. What I want to do is execute the exact same code twice and record a specified value for both of the runs. Is there an easy command or way to do this?
  댓글 수: 2
James Tursa
James Tursa 2017년 3월 20일
It isn't clear why you simply can't run the code again. What can't you run the code, record a value, and then run the code again?
Dhruvesh Patel
Dhruvesh Patel 2017년 3월 23일
Your question seems a bit vague. It would be nice if you could provide a small example scenario which depicts your requirement and even better if it is accompanied by some code.

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

답변 (1개)

Roger Stafford
Roger Stafford 2017년 3월 23일
@Andrew. You state that you are doing a Monte Carlo simulation. That is perhaps the reason why you have been unable to duplicate results, since randomness is involved. If that is the trouble, you should use the rng(seed) before each run to duplicate results.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by