how to run program 10 times
이전 댓글 표시
hello everybody
i want run the algorthim 10 time
then i want take the best
for each run i have result as a matrix any example 100 by 10
this 100 pareto front ,,
please any help
답변 (2개)
Image Analyst
2014년 2월 6일
It's just so basic we figured you probably figured it out by now. Use a for loop. Right? Or am I missing something?
for experiment = 1 : 10
results(experiment) = yourAlgorithm();
end
댓글 수: 3
Walter Roberson
2014년 2월 6일
For the case where the algorithm returns a matrix, one approach is
for experiment = 1 : 10
results{experiment} = yourAlgorithm();
end
but "then take the best" does not seem to be well defined. Do you perhaps mean something like
for experiment = 1 : 10
results{experiment} = yourAlgorithm();
score(experiment) = calculate_score(results{experiment});
end
[maxscore, maxidx] = max(score);
bestmatrix = results{maxidx};
bestresult = maxscore;
Image Analyst
2014년 2월 7일
편집: Image Analyst
2014년 2월 7일
ozgur's two "Answers" moved here.
i apply my algorthim to sove assignment problem ok
then i got result as a matrix like 100 by 10 ok
i want make again run and again to 10 times
and then take the best then i compare it with the result that valiable in internt it is multi objective
i think you didnt get my point
i will explain again simply ,,
there is a result pareto front avaliable in internt ok ,,
for my algorthim i run the algorthim 1 time to take the non dominat set ,,
then i plot it with the pareto front
it is working very well ok
but in the problem i am solving the pareto front avaliable is for some data only
so what i am gonna do
i want run my algorthim 10 time
each time i take result1 ,result2.....result10
i need simply in matlab take the best nondominat set ,, to compare it with 1 run only ....
did you got my point ?
Image Analyst
2014년 2월 7일
No, not yet. I don't know what a "result pareto front avaliable in internt" is, but I don't think that matters. I still don't know why storing all the results (one result each time you run your algorithm) and then examining all of your results like Walter showed you does not do the job. I don't know what a "non dominat" or a "nondominat" set is. Does it matter? Find the "best" can either be done in a loop by comparing the current "best" with the current result and keeping track of the current "best", like you learned in your first programming class, or can be done after the loop like Walter showed.
ozgur
2014년 2월 7일
0 개 추천
댓글 수: 1
Walter Roberson
2014년 2월 7일
I have no experience with it, but it looks straight-forward.
카테고리
도움말 센터 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!