6-3 以物件方式產????

Hqv覡ͰʵeiHOuɤOkvA]kF\hOŶCt@ӧޥʸkhOH覡ͰʵeAؤkݭnjqOAӥBiH͡uYɡv]Real-time^Ρuʦv]Interactive^ʵeC

MATLAB ҦϧΤ]uBB϶b^OAziHoǪ󪺦UةʽAدSʺ٬u⦡ϧΡv]Handle Graphics^AiԨĤCC⦡ϧΥ]thܼsAoAʵe򥻷äAHUڭ̥HuʵeӻC

C@uUCTةʽG

  1. xdataG@VqANu x yЭ
  2. ydataG@VqANu y yЭ
  3. EraseModeG@rANuQٰ覡AY xdata ydata QܮɡA¦uBz覡C

EraseMode ʵee{۷nAriOUCXؿܡG

bWz| EraseMode AӶOɶǬO

normal > xor > background > none

xor M background ܱAO background |٥hL¦uұLL]p϶bBuBt@u^AҥH֥ΨAҥH@bͰʵeɡA̱`Ψ쪺 EraseMode NO xorC

FoǷAͰʵeNܮeFIDnBJIG

  1. ͤ@uA EraseMode xorAbackgroundA noneC
  2. b for-loop Aܦu xdata ydata]Ψ̡^C
bHUҤlAڭ̲ͤ@H x ӰIu $$ y=sin(x+k)e^{x/5} $$

k HɶӫKj]Yܥiۨ^AϾuͻRʪĪGC{XpUG

Example 1: 06-ʵes@/movie04.mx = 0:0.1:8*pi; h = plot(x, sin(x).*exp(-x/5), 'EraseMode', 'xor'); axis([-inf inf -1 1]); % ]w϶bd grid on % eXu tic for i = 1:5000 y = sin(x-i/50).*exp(-x/5); set(h, 'ydata', y); % ]ws y y drawnow % ߧY@ end toc[Warning: The EraseMode property is no longer supported and will error in a future release. Use the ANIMATEDLINE function for animating lines and points instead of EraseMode 'none'. Removing instances of EraseMode set to 'normal', 'xor', and 'background' has minimal impact.] [> In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('movie04', 'd:\users\jang\books\matlabPRogramming4beginner\example\06-ʵes@\movie04.m', 2)" style="font-weight:bold">movie04</a> (<a href="matlab: opentoline('d:\users\jang\books\matlabPRogramming4beginner\example\06-ʵes@\movie04.m',2,0)">line 2</a>) In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('goWriteOutputFile>dummyFunction', 'd:\users\jang\books\goWriteOutputFile.m', 85)" style="font-weight:bold">goWriteOutputFile>dummyFunction</a> (<a href="matlab: opentoline('d:\users\jang\books\goWriteOutputFile.m',85,0)">line 85</a>) In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('goWriteOutputFile', 'd:\users\jang\books\goWriteOutputFile.m', 55)" style="font-weight:bold">goWriteOutputFile</a> (<a href="matlab: opentoline('d:\users\jang\books\goWriteOutputFile.m',55,0)">line 55</a>)] [Warning: The EraseMode property is no longer supported and will error in a future release. Use the ANIMATEDLINE function for animating lines and points instead of EraseMode 'none'. Removing instances of EraseMode set to 'normal', 'xor', and 'background' has minimal impact.] [> In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('movie04', 'd:\users\jang\books\matlabPRogramming4beginner\example\06-ʵes@\movie04.m', 2)" style="font-weight:bold">movie04</a> (<a href="matlab: opentoline('d:\users\jang\books\matlabPRogramming4beginner\example\06-ʵes@\movie04.m',2,0)">line 2</a>) In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('goWriteOutputFile>dummyFunction', 'd:\users\jang\books\goWriteOutputFile.m', 85)" style="font-weight:bold">goWriteOutputFile>dummyFunction</a> (<a href="matlab: opentoline('d:\users\jang\books\goWriteOutputFile.m',85,0)">line 85</a>) In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('goWriteOutputFile', 'd:\users\jang\books\goWriteOutputFile.m', 55)" style="font-weight:bold">goWriteOutputFile</a> (<a href="matlab: opentoline('d:\users\jang\books\goWriteOutputFile.m',55,0)">line 55</a>)] Elapsed time is 20.510184 seconds.

]WϥuqX̫@ frame eC^bWҤAڭ̨ϥ set OA`@ܦu y y 5000 AåH xor 覡ٱ¦uC䤤 drawnow @άO MATLAB ߨBz set OAYL drawnowAMATLAB |ֿn set OA for-loop ɦA@ֳBzϧΪܤơAoɴN|ݨʵeĪGC

pGzNWҪ EraseMode 令 backgroundAh|o{u|YϧΤuΥN϶buAиոլݡI

pGzNWҪ EraseMode 令 noneAhªu|QOdUӡAͤPĪGAиոլݡI]YnLXعϧΡAаOob print O[W Vzbuffer ﶵC^

H覡e{ʵeҤl۷hAŪ̥iHոդUCOG

O
lorenz H3Dʵee{ Lorenz VP{]Chaotic Equation^AnzPbBC
truss @y٦ba_ɪ_ʤ覡A@ 12 سI
travel ܦpH÷jM]Random Search^覡Ӹ Traveling Salesperson Problem.
fitdemo ܦpH Downhill Simplex Search ӸѨMDuʦuX]Nonlinear Curve Fitting^DC
spinner `ùO@{C
xphide ոձzOKC

Yzw SimulinkAiոդUCʺAtμ[Wʵee{G

O
onecart DzΪu®[W|XʺAtΡC
dblcart1 @u®[Wӯ|XʺAtΡC
simppend ²檺\tΡC
dblpend1 I\ʨtΡC
dblpend2 \ʨtΡC
penddemo ˳\tΡC

pGzw Fuzzy Logic ToolboxAiHոեѵ̿˦۶}oUΰʵeiܡG

O
fcmdemo Fuzzy C-means ClusteringC
juggler ΪOlֲyC
invkine Iu Inverse KinematicsC
slcp1 ˳\AlHɶܡAziHұFmC
slcpp1 ˳\A䤤@ӱlHɶܡAziHұFmC
slbb ߪO[WuytΡAziHy̫mC
sltbu ˨Jwt


MATLAB{]pGJg