8-2 ��������������������?

YnBz@ƾǨơAڭ̥NƾǨƼg MATLAB 禡APɨϥΦrܼƨӥN禡AHKiU@BBzC@ӻAڭ̦ؤ覡iHΡG

bUoӽdҡAڭ̴Nϥγoؤ覡ӫw humps.m 禡Aåfplot OӶi榹ƾǨƪ@ϡCҦpAYneX humps Ʀb [0,2] uAiJpUG

Example 1: 08-@ƾǨƪBzPR/fplot01.msubplot(2,1,1); fplot('humps', [0,2]); % ϥΦrw禡 subplot(2,1,2); fplot(@humps, [0 2]); % ϥΨ禡ӫw禡[Warning: Char input to fplot will be removed in a future release. Use fplot(humps) instead.] [> In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('fplot', 'C:\Program Files\MATLAB\toolbox\matlab\specgraph\fplot.m', 105)" style="font-weight:bold">fplot</a> (<a href="matlab: opentoline('C:\Program Files\MATLAB\toolbox\matlab\specgraph\fplot.m',105,0)">line 105</a>) In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('fplot01', 'D:\users\jang\books\matlabProgramming4guru\example\08-@ƾǨƪBzPR\fplot01.m', 2)" style="font-weight:bold">fplot01</a> (<a href="matlab: opentoline('D:\users\jang\books\matlabProgramming4guru\example\08-@ƾǨƪBzPR\fplot01.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>)]

ѤWzdҥiAϥΦrM禡Aұo쪺GO@˪CHUdҡANɶqϥΨ禡ӫw禡A]oO MATLAB s䴩覡AӥBIJv]C

ϥ fplotAz]iHPɧ x M y ϶AҦpG

Example 2: 08-@ƾǨƪBzPR/fplot02.mfplot(@humps, [0 1 5 25]); grid on % eXuError in running fplot02! (Logged to scriptError.log)

x ϶ [0, 1]Ay ϶ [5, 25]C

fplot ]uܡvƾǨơAӤonNƾǨƼg MATLAB禡AҦpG

Example 3: 08-@ƾǨƪBzPR/fplot021.msubplot(2,1,1); fplot('sin(2*x)+cos(x)', [-10, 10]) % ϥΦrw禡 subplot(2,1,2); fplot(@(x)sin(2*x)+cos(x), [-10, 10]) % ϥΨ禡ӫw禡[Warning: Char input to fplot will be removed in a future release. Use fplot(@(x)sin(2.*x)+cos(x)) instead.] [> In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('fplot', 'C:\Program Files\MATLAB\toolbox\matlab\specgraph\fplot.m', 105)" style="font-weight:bold">fplot</a> (<a href="matlab: opentoline('C:\Program Files\MATLAB\toolbox\matlab\specgraph\fplot.m',105,0)">line 105</a>) In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('fplot021', 'D:\users\jang\books\matlabProgramming4guru\example\08-@ƾǨƪBzPR\fplot021.m', 2)" style="font-weight:bold">fplot021</a> (<a href="matlab: opentoline('D:\users\jang\books\matlabProgramming4guru\example\08-@ƾǨƪBzPR\fplot021.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>)]

bWzdҤAڭ̤]PɨϥΤFrM禡ӫwƾǨ sin(2x)+cos(x) C

fplot O]iPɹhӨƧ@ϡAuݭnNoǨƩJ@ӦVqYiAdҦpUG

Example 4: 08-@ƾǨƪBzPR/fplot022.m% fplot OiPɹhӨƧ@ fplot(@(x)[sin(x), exp(-x)], [0, 10])

bi榹عBɡAiNܼ x ݦO@ӦVq]Column Vector^A [sin(x), exp(-x)] hOGӦVqACӦVqN@Өơ]Y@u^C

fplot 򥻤W]OyI@ϡA plot(x, y)AuO x yIK׬OھڨƭȪܤƦӨMwA]iͤꡨƹϧΡC fplot Ҳͪ x yIAiJpUG

Example 5: 08-@ƾǨƪBzPR/fplot03.m[x, y] = fplot(@humps, [-1,2]); plot(x, y, '-o');[Warning: Having two output arguments for fplot will be removed in a future release. Use the XData and YData properties instead.] [> In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('fplot', 'C:\Program Files\MATLAB\toolbox\matlab\specgraph\fplot.m', 171)" style="font-weight:bold">fplot</a> (<a href="matlab: opentoline('C:\Program Files\MATLAB\toolbox\matlab\specgraph\fplot.m',171,0)">line 171</a>) In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('fplot03', 'D:\users\jang\books\matlabProgramming4guru\example\08-@ƾǨƪBzPR\fplot03.m', 1)" style="font-weight:bold">fplot03</a> (<a href="matlab: opentoline('D:\users\jang\books\matlabProgramming4guru\example\08-@ƾǨƪBzPR\fplot03.m',1,0)">line 1</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>)]

ѤWϥiAfplot |bܤƥwBAW}IAӦbܤƼ@PBA͸KIC

YͧK x yIAib fplot O[Jt@ӥN۹eԫס]Tolerance^J޼ơA|ҦpUG

Example 6: 08-@ƾǨƪBzPR/fplot04.msubplot (2,1,1); fplot(@(x)sin(1./x), [0.01,0.1]); subplot (2,1,2); fplot(@(x)sin(1./x), [0.01,0.1], 0.0001);[Warning: The tolerance parameter input to fplot has been removed.] [> In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('fplot', 'C:\Program Files\MATLAB\toolbox\matlab\specgraph\fplot.m', 89)" style="font-weight:bold">fplot</a> (<a href="matlab: opentoline('C:\Program Files\MATLAB\toolbox\matlab\specgraph\fplot.m',89,0)">line 89</a>) In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('fplot04', 'D:\users\jang\books\matlabProgramming4guru\example\08-@ƾǨƪBzPR\fplot04.m', 4)" style="font-weight:bold">fplot04</a> (<a href="matlab: opentoline('D:\users\jang\books\matlabProgramming4guru\example\08-@ƾǨƪBzPR\fplot04.m',4,0)">line 4</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>)]

bĤ@ϤAfplot OϥΤFw]۹eԫסAȬ 0.002FbĤGϤA۹eԫ׳Q] 0.0001A]ڭ̥iHoǽTϧΡA۹]nhpΧ@ϮɶC

ezplot OM fplot OAuLϥΤW²KCҦpAYneXTh $f(x)=x^3-x^2+x$ ϧΡAiJpUG

Example 7: 08-@ƾǨƪBzPR/ezplot01.mezplot(@(x)x^3-x^2+x);[Warning: Function failed to evaluate on array inputs; vectorizing the function may speed up its evaluation and avoid the need to loop over array elements.] [> In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('ezplot>ezplot1', 'C:\Program Files\MATLAB\toolbox\matlab\specgraph\ezplot.m', 498)" style="font-weight:bold">ezplot>ezplot1</a> (<a href="matlab: opentoline('C:\Program Files\MATLAB\toolbox\matlab\specgraph\ezplot.m',498,0)">line 498</a>) In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('ezplot', 'C:\Program Files\MATLAB\toolbox\matlab\specgraph\ezplot.m', 154)" style="font-weight:bold">ezplot</a> (<a href="matlab: opentoline('C:\Program Files\MATLAB\toolbox\matlab\specgraph\ezplot.m',154,0)">line 154</a>) In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('ezplot01', 'D:\users\jang\books\matlabProgramming4guru\example\08-@ƾǨƪBzPR\ezplot01.m', 1)" style="font-weight:bold">ezplot01</a> (<a href="matlab: opentoline('D:\users\jang\books\matlabProgramming4guru\example\08-@ƾǨƪBzPR\ezplot01.m',1,0)">line 1</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>)]

ezplot Ow]@ϽdO $[-2\pi, 2\pi]$ApWϩҥܡC

ezplot ]iΩeXѼƦuAbUCdҤAڭ̨ϥ ezplot ӵeXܪi`ݨ쪺QĦpϧΡ]LissajiousFiguers^ApUG

Example 8: 08-@ƾǨƪBzPR/ezplot02.m% ezplot ieXѼƦu ezplot(@(t)sin(3*t), @(t)cos(5*t));

beѼƦuɡAѼƪw]d򤴵MO $[-2\pi, 2\pi]$C

ezplot OiΩƪ@ϡAҦpYneX $x^3+2x^2-3x+5-y^2+10=0$ ϡAiHUCdҡG

Example 9: 08-@ƾǨƪBzPR/ezplot03.m% ezplot OiΩƪ@ ezplot(@(x,y)x^3+2*x^2-3*x-y^2+15);[Warning: Function failed to evaluate on array inputs; vectorizing the function may speed up its evaluation and avoid the need to loop over array elements.] [> In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('ezplotfeval', 'C:\Program Files\MATLAB\toolbox\matlab\specgraph\private\ezplotfeval.m', 56)" style="font-weight:bold">ezplotfeval</a> (<a href="matlab: opentoline('C:\Program Files\MATLAB\toolbox\matlab\specgraph\private\ezplotfeval.m',56,0)">line 56</a>) In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('ezplot>ezimplicit', 'C:\Program Files\MATLAB\toolbox\matlab\specgraph\ezplot.m', 267)" style="font-weight:bold">ezplot>ezimplicit</a> (<a href="matlab: opentoline('C:\Program Files\MATLAB\toolbox\matlab\specgraph\ezplot.m',267,0)">line 267</a>) In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('ezplot', 'C:\Program Files\MATLAB\toolbox\matlab\specgraph\ezplot.m', 163)" style="font-weight:bold">ezplot</a> (<a href="matlab: opentoline('C:\Program Files\MATLAB\toolbox\matlab\specgraph\ezplot.m',163,0)">line 163</a>) In <a href="matlab:matlab.internal.language.introspective.errorDocCallback('ezplot03', 'D:\users\jang\books\matlabProgramming4guru\example\08-@ƾǨƪBzPR\ezplot03.m', 2)" style="font-weight:bold">ezplot03</a> (<a href="matlab: opentoline('D:\users\jang\books\matlabProgramming4guru\example\08-@ƾǨƪBzPR\ezplot03.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>)]

ezplot O٦䥦ﶵAiԨ MATLAB uW䴩C

Hint
uezplotvuezvYN^媺ueasyvAYNOu²evNCøϫO٦ ezplot3BezpolarBezsurfBezmeshBezsurfcBezmeshcBecontourAezcontourf AԨ MATLAB uW䴩C


MATLAB{]pGig