MATLAB Answers

Eugene
1

Publish main code with clickable links to subroutines

Asked by Eugene
on 8 Feb 2011
Latest activity Answered by Rolfe Dlugy-Hegwer on 18 Dec 2013
Hello,
I have a question regarding publishing a Matlab code (which I have never done before), to a html file (and I have no experience with html either).
I have a rather long code, with over 50 related subroutines, not including those built in Matlab subroutines. When I run the profiler the subroutines appear in whatever code I run as (what I believe are) hyperlinks, clicking on these allows me to step into such a subroutine within the profile output. Is it possible to create something similar using the publish function? So the user can peruse through the main code and step into any subroutines as they appear?
So far if I publish the commented main program to a html document (with the code visible) none of the subroutines appear, though I am unclear if any options I can choose from will automatically create the output that I want. Will I have to publish every individual subroutine program to a html file, place them all in one folder, and then create a hyperlink to each subroutine individually where they are called by other subroutines? I presume this would be a static hyperlink as all html files will be in the same folder? Will these hyperlinks have to appear in comment sections, or can I have them within the 'displayed code' of the published document?
I do not want to run the code while publishing as there are too many options throughout and it's not possible to cycle through everything in one run.
Apologies for the basic level of these queries, but I have no experience with either of these features.
Thanks

  2 Comments

This is a valid question.
I think publishing code is not excactly what you are looking for. Publishing is for getting a clean and to-the-point report showing one single run including the results.
What you seem to want is to publish the documentation, much like what javadoc or Doxygen do. If you go to the Current Folder browser, click the cog wheel and select Reports->Help Report, or one of the other reports, that might give you something closer to what you want.

Sign in to comment.

1 Answer