# MATLAB’s publish function

Have you discovered the Publish to HTML functionality in MATLAB 7 yet? If not, you should definitely check it out.

I generated the HTML for my recent blog entry, Synthesizing images using simple equations, directly from an M-file script.

For example, the "Start with meshgrid" section was generated from this part of the M-file:

%% Start with meshgrid
% The MATLAB function |meshgrid| is extremely useful for computing a
% function of two Cartesian coordinates, and you can make some interesting
% images this way.
%
% |meshgrid| is kind of hard to explain in words.  It's easier to just look
% at what it does.

x = 1:3;
y = 10:14;
[xx, yy] = meshgrid(x, y)


Output in the command window is automatically captured and included in the generated HTML, and any figures created are also captured and stored as image files.

In addition to HTML, you can also publish to Word, to LaTeX, to PowerPoint, or to XML.

Read more about this MATLAB feature in the Users Guide. You should also check out Loren Shure's Art of MATLAB blog on MATLAB Central.

|