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

Respuestas (2)

Image Analyst
Image Analyst el 6 de Feb. de 2014

0 votos

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 comentarios

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
Image Analyst el 7 de Feb. de 2014
Editada: Image Analyst el 7 de Feb. de 2014
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
Image Analyst el 7 de Feb. de 2014
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.

Iniciar sesión para comentar.

ozgur
ozgur el 7 de Feb. de 2014

0 votos

ok i applied it is work ,, thank you
now i want to call this function
do you have any experince with it

1 comentario

Walter Roberson
Walter Roberson el 7 de Feb. de 2014
I have no experience with it, but it looks straight-forward.

Iniciar sesión para comentar.

Categorías

Más información sobre Graphics Performance en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 6 de Feb. de 2014

Comentada:

el 7 de Feb. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by