Why Would an m-file run quickly but publishing it runs slowly?
Mostrar comentarios más antiguos
I have created a relatively short m-file that runs completely in ~10 seconds and produces the output I expect (couple of plots). However, publishing it to either a pdf or html causes it to slowdown. Very slow. It takes about 20 minutes to publish.
Are there particular functions I should look out for? I'm confused since it obviously solves very quickly.
This will probably require some discourse since I'm not going to post my code here (yet). This is a homework assignment and I don't want to post this online until it's due (later this week), so there is the ability to discuss it then.
1 comentario
Walter Roberson
el 19 de Sept. de 2012
Possibly you are publishing at much higher resolution ?
Respuestas (1)
Ken Atwell
el 19 de Sept. de 2012
0 votos
We'd need the code to be sure, but I'll guess that publishing is causing the JIT to not kick in some situation when normally it would kick in when running freely.
Bracketing each block of code with tic/toc will narrow down the culprit, and then maybe you can share just that one subsection here on Answers.
2 comentarios
Ken Atwell
el 19 de Sept. de 2012
Turn all three "%%"'s into just "%". I believe publishing will pause to gather state whenever it encounters a "%%", so don't do this within your loop.
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!