Readme

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 3

Welcome to the MATLAB Notebook for Word!

Version 1.5.2

This document contains information on:


1. Getting Started
2. A Brief MATLAB Example

1. Getting Started
The MATLAB Notebook is an interface for accessing MATLAB in a seamless manner
through Microsoft Word.The Notebook interface allows commands created within a Word
document to be sent to MATLAB for evaluation. The result of MATLAB's processing of
the command is returned to Word and inserted in the document. Both text and graphical
output from MATLAB are supported.

The document which you are reading is a live MATLAB Notebook or M-book. You
probably noticed that when this document was opened, the MATLAB program was
started. This is so that commands entered in the M-book can be sent to MATLAB and
evaluated.

The best place to start with the Notebook is Chapter 2 of the MATLAB Notebook User's
Guide. If you are impatient, on the next line type a MATLAB expression and press Ctrl-
Enter. Working with the Notebook is easy!

After perusing this document you will want to create an m-book of your own. To do this
select New M-book from the File menu.
2. A Brief MATLAB Example
Here's an example of mixing MATLAB commands and free form text.

Use MATLAB's magic function to generate a magic square matrix. Try changing the value in the
parenthesis and then re-evaluate this M-book by pressing Alt-R.

x=magic(12)

x =
Columns 1 through 8
144 2 3 141 140 6 7 137
13 131 130 16 17 127 126 20
25 119 118 28 29 115 114 32
108 38 39 105 104 42 43 101
96 50 51 93 92 54 55 89
61 83 82 64 65 79 78 68
73 71 70 76 77 67 66 80
60 86 87 57 56 90 91 53
48 98 99 45 44 102 103 41
109 35 34 112 113 31 30 116
121 23 22 124 125 19 18 128
12 134 135 9 8 138 139 5
Columns 9 through 12
136 10 11 133
21 123 122 24
33 111 110 36
100 46 47 97
88 58 59 85
69 75 74 72
81 63 62 84
52 94 95 49
40 106 107 37
117 27 26 120
129 15 14 132
4 142 143 1

The imagesc command creates an image of the matrix scaling the data for the colormap. For an
explanation of the imagesc command, on the next line type "help imagesc" and press Ctrl-Enter.

imagesc(x)
2

10

12
2 4 6 8 10 12

You might also like