You are on page 1of 2

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

10

12 2 4 6 8 10 12

You might also like