I've created an .m file that pulls and sorts data into a UI table, then I have the ability to publish this to either html or pdf form. I can click in the GUI of matlab publish button and it perfectly prints the table once to publication, but if i insert: publish('MTRChecks.m','html'); at the end of the code, then the program will loop endlessly regenerating the same table without publishing it.
I am using Matlab 2013 B, while not ideal it is my only option.
Have a look here, you are most probably using the
publishcall in the wrong way, aspublishfunction call takes care of running the script provided as the first argument, adding the call at the bottom of the script would lead such an infinite call.