DOCUMENT TITLE

INTRODUCTORY TEXT

Contents

SECTION TITLE

DESCRIPTIVE TEXT

% create a report like this:
% publish('myscript.m', 'html')

BOLD TEXT

PREFORMATTED
TEXT

That was with two spaces after the percent (%)

An image:

  1. ITEM1

onetwo

  1. ITEM2

Latex table

End of latex table

$$e^{\pi i} + 1 = 0$$

% snapnow;

Trying stuff on my own

In star and under bars and vertical bars

display for output

Perhaps what I really want is a notebook that lets me include output from matlab commands. But notebook is only available on windows

% If you put a blank line, it goes back to doing regular matlab comments

% If I want to put text into the output stream, display works, but the
% display is in the resulting code

display('hello world')
display('hello world with ;');
hello world
hello world with ;

sprintf can help

val1 = 0.123456789; % ; suppresses putting the result value into the publish output
val2 = 3.14 % This will be in the publish

display(sprintf('Values: %0.3f %d %d',val1,val2, 3))

sprintf('Values: %0.3f %d %d',val1,val2, 3)
val2 =

    3.1400

Values: 0.123 3.140000e+00 3

ans =

Values: 0.123 3.140000e+00 3

References

This has a table of markups at the very bottom of the page. Put links in angle brackets Marking Up MATLAB Comments for Publishing