run a program multiple times and report result
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
How to run a MATLAB program multiple times and write outputs to a text file?can we do this in matlab in windows environment? Please help ....... Thanking You, Sita
2 comentarios
Jan
el 23 de En. de 2012
Please decide, if you want to run a C-program, like in the header, *or* a Matlab program, like in the body of the question.
Respuesta aceptada
Jan
el 24 de En. de 2012
You do not have to restart Matlab to run a Matlab program. It is much faster to do this in a loop inside Matlab.
diary('D:\Temp\Result.txt');
for i = 1:10000
callYourFunction()
end
diary('off');
Of course you can use other methods than diary to create the log file, e.g.:
Str = evalc('callYourFunction')
and append the string Str to a text file. There are more possibilities, but currently the problem description is not clear enough to decide for a solution.
0 comentarios
Más respuestas (1)
Walter Roberson
el 23 de En. de 2012
matlab -r YourFunctionName > OutputFileName
4 comentarios
Walter Roberson
el 24 de En. de 2012
Sorry, as I indicated, I do not have much experience with Windows BAT files. At home I am running all Mac, and at work I only have access to Linux systems.
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!