Execute same .m multiples times in parallel

I have a script that generate images based on a random float. To generate the number, i use the following:
timeVals = strsplit(sprintf('%.9f',now),'.');
rng(str2double(timeVals{2}))
One problem is that the generation of the image takes a lot of time and i need a huge dataset, so i want to execute the same script to get it faster.
  1. It's possible to execute the same .m multiples times in parallel?.
  2. It's correct how the random numbers are generated in case that the step 1 could be possible?
Thanks in advance

댓글 수: 1

KSSV
KSSV 2022년 10월 31일
Generation of the image? Where are you generating image?

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

 채택된 답변

Bruno Luong
Bruno Luong 2022년 10월 31일

1 개 추천

You have to wrap your script in function and then call parfor if you have parallel toolbox.
Please read about precautions of seading in the Tip part of doc page of rng function

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Random Number Generation에 대해 자세히 알아보기

제품

릴리스

R2022b

질문:

2022년 10월 31일

답변:

2022년 10월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by