02.03.2016 Views

MATLAB by rudra pratap

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

58 Tutorial Lessons<br />

2.11 Lesson 11: Publishing Reports<br />

Goal: To learn how to use <strong>MATLAB</strong>'s built-in publisher for publishing reports of<br />

your <strong>MATLAB</strong> work as attractive HTML or MS Word documents (other options<br />

such as Ib-TEX and PowerPoint are also available).<br />

Time Estimates<br />

Lesson: 20 minutes<br />

Exercises: 30 minutes<br />

What you are going to learn<br />

• How to create a cell script for <strong>MATLAB</strong> publisher.<br />

• How to execute the script.<br />

• How to publish the script and its results in an HTML file.<br />

• How to publish the script and its results in a Word file.<br />

• How to learn more about fancy formatting for the publisher.<br />

Method: <strong>MATLAB</strong> includes an automatic report generator called publisher.<br />

This publisher is accessible, like many other utilities, both from the menu and<br />

the command line. The publisher publishes a script in several formats, including<br />

HTML, XML, MS Word, PowerPoint, and I¥IE;X. Here you will write a simple<br />

script and publish it both as an HTML document and a Word document. Follow<br />

the steps below.<br />

1. First, open a new file in the editor and enter the following lines (including<br />

blank lines). The only thing new here is the double percent (%%) character.<br />

It indicates the beginning of a new cell, a unit of a set of commands (see<br />

Exercises) . The text in a line beginning with %% is used as the title of that<br />

section (or cell) <strong>by</strong> the publisher.<br />

%% Publishing Reports - A Simple Example<br />

%% A Spiral Plot<br />

% Let us plot a spiral given <strong>by</strong><br />

% r(t) = exp (-theta/10) , O

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!