The publish command in MATLAB lets you quickly generate a formatted file, as an example for others, that contains MATLAB code, results from running the code, and an interactive table of contents.
By publishing MATLAB code as examples, you can:
The published MATLAB code can be output in the following formats: HTML, PDF, PPT, DOC, LaTeX, and XML.
Explore MATLAB Central to find MATLAB examples that support your teaching and research. You can share your examples by either posting them on MATLAB Central File Exchange or linking to them on MATLAB Central Link Exchange.
Publishing MATLAB Code from the Editor 5:57
Share your work by publishing MATLAB® code from the MATLAB Editor to HTML and other formats.
"Publishing MATLAB examples is valuable to researchers as they disseminate their work, and it also enables course instructors and students to effectively share their MATLAB based classroom demonstrations and homework exercises."
Professor Iyad Obeid, Department of Electrical and Computer Engineering, Temple UniversityDemonstration of MATLAB Publishing
"My students used to submit MATLAB files in homework, which required me to run their scripts and find the results among everything the script produced. Now my students publish their solutions in MATLAB, which lets everyone see both inputs and outputs as I grade exercises. It has really simplified the grading process."
Professor Jake Blanchard, Department of Engineering Physics, University of WisconsinMATLAB Example Published to HTML