- Page 2 and 3:
BASICS OFMATLAB®and Beyondc○ 200
- Page 4 and 5:
Library of Congress Cataloging-in-P
- Page 6 and 7:
typing pwd (print working directory
- Page 8 and 9:
ContentsIBasics of MATLAB1 First St
- Page 10 and 11:
20 Time-Frequency Analysis21 Line A
- Page 12 and 13:
39Answers to Exercises (Part I)40 A
- Page 14 and 15:
Set → Getting Started with MATLAB
- Page 16 and 17:
1.5 The Colon OperatorTo generate a
- Page 18 and 19:
matlab will recall the last command
- Page 20 and 21:
a = zeros(2,3)a =0 0 00 0 0>> b = o
- Page 22 and 23:
[a a(a)]ans =1 2 3 1 4 74 5 6 2 5 8
- Page 24 and 25:
a + bans =11 3344 6677 993.8 Transp
- Page 26 and 27:
4.2 Adding PlotsWhen you issue a pl
- Page 28 and 29:
x = [[1 2 3 4]’ [2 3 4 5]’ [3 4
- Page 30 and 31:
4.7 AxesSo far we have allowed matl
- Page 32 and 33:
v =1122>> v*uans =1 2 0 11 2 0 12 4
- Page 34 and 35:
max returns a vector containing the
- Page 36 and 37:
s = 100*spiral(3)s =700 800 900600
- Page 38 and 39:
We can plot the surface z as a func
- Page 40 and 41:
The contour function plots the cont
- Page 42 and 43:
m = gray(8);colormap(m)imagesc(1:10
- Page 44 and 45:
hold onplot3(x(ind),y(ind),z(ind),
- Page 46 and 47:
z = 5*ones(3,3)z =5 5 55 5 55 5 5>>
- Page 48 and 49:
contour(x,y,z,30);You may have noti
- Page 50 and 51: variables that are local to themsel
- Page 52 and 53: SwitchThe basic form of a switch st
- Page 54 and 55: i =i =123136Vectorised Codematlab i
- Page 56 and 57: 9.1 MATLAB FormatTo save all the va
- Page 58 and 59: 11 StartupEach time you start matla
- Page 60 and 61: Where p i is the population for yea
- Page 62 and 63: NaNs by leaving them off the plot.
- Page 64 and 65: clfpolar(t,gdb)In this case you mus
- Page 66 and 67: -0.5000-0.3750-0.2500-0.125000.1250
- Page 68 and 69: the periodograms of the blocks, and
- Page 70 and 71: plot(y(1:1000))axis([0 1000 -5 5])z
- Page 72 and 73: comet(x,y)(You can get a three-dime
- Page 74 and 75: By clicking within the panner box a
- Page 76 and 77: x = linspace(-1,1,8192);Fs = 1000;y
- Page 78 and 79: 23.3 Graphical Object Hierarchymatl
- Page 80 and 81: Now we need to get the handles of a
- Page 82 and 83: Beyond the BasicsPreludeThis part o
- Page 84 and 85: clfgplot(A,[x y])axis off(Try zoomi
- Page 86 and 87: str =you’re the one>> str = ’
- Page 88 and 89: strrep(str,’go’,’am’)ans =I
- Page 90 and 91: ans =3.14159e+100Some additional te
- Page 92 and 93: eval(str)v =1 2 3 4 5The eval(str)
- Page 94 and 95: Inline objects, like every other ma
- Page 96 and 97: a(1,1) = {[1 2 3]}a =[1x3double]or>
- Page 98 and 99: t = {’help’ spiral(3) ; eye(2)
- Page 102 and 103: We can capture this list by giving
- Page 104 and 105: a(:,:,3) =3 3 33 3 33 3 3Indexing f
- Page 106 and 107: 29.2 Operations with Multidimension
- Page 108 and 109: We define a red disc by setting all
- Page 110 and 111: whosName Size Bytes Classdata 128x1
- Page 112 and 113: matrices, strings, structures, or o
- Page 114 and 115: whosName Size Bytes Classa 1x1 8 do
- Page 116 and 117: aureadwavreadreadsndRead SUN (‘.a
- Page 118 and 119: 31 Handle GraphicsHandle Graphics i
- Page 120 and 121: There are usually a great many prop
- Page 122 and 123: without specifying a property you g
- Page 124 and 125: delete(h(1:2))We can now issue the
- Page 126 and 127: set(gcf,’units’)[ inches | cent
- Page 128 and 129: 31.2 Default Object PropertiesEvery
- Page 130 and 131: ans =[]>> gcfans =1Exercise 16 The
- Page 132 and 133: Some new data now:t = linspace(0,1)
- Page 134 and 135: The axis command works by changing
- Page 136 and 137: The tick labels can be either numbe
- Page 138 and 139: for yi = 1:Nyfor ti = 1:Ntcount = c
- Page 140 and 141: These commands change special Text
- Page 142 and 143: x = linspace(0,2);y = 1./(1-x);plt(
- Page 144 and 145: x = linspace(0,1,200);y = humps(x);
- Page 146 and 147: (Try pushing the button.) The avail
- Page 148 and 149: Callbacks are fastest when they are
- Page 150 and 151:
The two inner frames are labeled by
- Page 152 and 153:
set(h,’string’,{’Red’;’Gr
- Page 154 and 155:
handles into a vector when they are
- Page 156 and 157:
uimenu(f,’Label’,’Black’,..
- Page 158 and 159:
set(h,’xdata’,t,’ydata’,sin
- Page 160 and 161:
are the same size and aligned at th
- Page 162 and 163:
35.2 Print Size: WYSIWYGBy default,
- Page 164 and 165:
%!PS-Adobe-2.0%%Creator: MATLAB, Th
- Page 166 and 167:
\includegraphics[width = \textwidth
- Page 168 and 169:
ut it will be high quality when pri
- Page 170 and 171:
x 294x1 2352 double arrayxi 50x50 2
- Page 172 and 173:
Simple Two-Dimensional PatchesTo de
- Page 174 and 175:
xt = [0 1 .5];yt = [0 0 1];zt = [0
- Page 176 and 177:
The matlab code to draw the triangu
- Page 178 and 179:
MarkerEdgeColor The colour of the m
- Page 180 and 181:
The patch function has automaticall
- Page 182 and 183:
The colour of each vertex is indexe
- Page 184 and 185:
cols = [1 1 11 1 00 1 0];for i = 1:
- Page 186 and 187:
To get the following result Iused t
- Page 188 and 189:
do very fast operations on the appr
- Page 190 and 191:
The last row needs special treatmen
- Page 192 and 193:
xcentre = -0.6;ycentre = 0;L = 1.5;
- Page 194 and 195:
39 Answers to Exercises(Part I, Bas
- Page 196 and 197:
If you zoom in on the right hand pl
- Page 198 and 199:
40 Answers to Exercises(Part II, Be
- Page 200 and 201:
x = linspace(lims(1),lims(2));y = f
- Page 202 and 203:
pos2 = [scr_width/2 + edgethickness
- Page 204 and 205:
x = [0 0 1 1 0 .41 1 1 0 0 .41 .6 .