You are on page 1of 95

# Khao sat ng dung MATLAB trong ieu khien t ong

## TAP LE ! "# BA\$

&'

"%\$A MATLAB

LE ! "# BA\$

"hu () Cac lenh eu viet bang ch thng, nhng v tac gia muon viet hoa e ngi xem tien theo oi! *' Lenh A + a" Co#ng u\$ng% ,Pur-ose. &a bien cha 'et (ua ma)c *nh! b" +iai th,ch% ,/es0ri-tion. -hi th\$c hien mot lenh nao o ma cha co bien cha 'et (ua, th ./0&/1 la2 bien /n3 lam bien cha 'et (ua o! c" 4, u\$% ,E1a2-3es. 567 an3 8 7 4' Lenh "L5"K a" Co#ng u\$ng% ,Pur-ose. 0ho#ng bao nga2 gi hien ta\$i! b" Cu 9ha9%,+(nta1. c 8 cloc' c" +iai th,ch% ,/es0ri-tion. :e tho#ng bao e; o\$c ta ung ham <ix! " 4, u\$% ,E1a2-3es. c 8 cloc' c8 7!=e>==?@ 5!==7= =!==A= =!=5== =!==?= =!=A5= =!=B=7 c 8 <ixCcloc'" c 8 5==7 A 5= ? A? ? 6' Lenh "5MP%TE7 a" Co#ng u\$ng% ,Pur-ose. Cho biet he ieu hanh cua ma2 vi t,nh ang 3 u\$ng .atlab! b" Cu 9ha9% ,+(nta1. com9uteD Ec,mF 8 com9uteD 0h\$c hien% GH/I. JKLMC 0NOPQR+ JK/R+ HKT 676 +4HS% GH/I.

Khao sat ng dung MATLAB trong ieu khien t ong c" +iai th,ch% ,/es0ri-tion. c% cha tho#ng bao he ieu hanh cua ma2! m% 3o 9han t cua ma tDan ln nhat ma ma2 co the lam viec \$c vi .atlab! " 4, u\$% ,E1a2-3es. U Ec,mF8com9uteD c8 GCVWR

m8 5!7AXBe>==Y 8' Lenh /ATE a" Co#ng u\$ng% ,Pur-ose. 0ho#ng bao nga2 thang naZm hien ta\$i b" Cu 9ha9% ,+(nta1. 3 8 ate c" 4, u\$% U 38 ate 38 5=6/9D65==7 9' Lenh "/ a" Co#ng u\$ng% Chu2en oi th mu\$c lam viec! b" Cu 9ha9% c c iDetoD2 c !! c" +iai th,ch% 0h\$c hien% GH/I. JKLMC 0NOPQR+ JK/R+ HKT 656 +4HS% GH/I.

Khao sat ng dung MATLAB trong ieu khien t ong b" Cu 9ha9% elete <ilename elete Cn" c" +iai th,ch% <ile name% te#n ta9 tin can xoa! n% bien cha oi t\$ng o ho\$a can xoa! Reu oi t\$ng la mot ca 3o th ca 3o 3e ong la\$i va b* xoa! =' Lenh /EM5 a" Co#ng u\$ng% Cha\$2 chng tDnh ma)c *nh cua .atlab! b" Cu 9ha9% emo c" +iai th,ch% emo% la chng tDnh co 3a]n tDong tDong .atlab, chng tDnh na2 minh ho\$a mot 3o chc naZng cua .atlab! *>' Lenh /&A7? a" Co#ng u\$ng% &u vung thanh <ile tDe#n ^a! b" Cu 9ha9% iaD2 <ilename c" +iai th,ch% <ilename% te#n cua ta9 tin! **' Lenh /&7 a" Co#ng u\$ng% &iet 'e# cac ta9 tin va th mu\$c! b" Cu 9ha9% iD iD name c" +iai th,ch% iD% liet 'e# cac ta9 tin va th mu\$c co tDong th mu\$c hien hanh! iD name% ng a;n en th mu\$c can liet 'e#! *4' 3enh /&+P a" Co#ng u\$ng% 0Dnh ba2 noi ung cua bien Cx" Da man hnh 0h\$c hien% GH/I. JKLMC 0NOPQR+ JK/R+ HKT 6A6 +4HS% GH/I.

Khao sat ng dung MATLAB trong ieu khien t ong b" Cu 9ha9% i39 Cx" c" giai th,ch% x% la te#n cua ma tDan ha2 la te#n cua bien cha chuo;i '2 t\$, neu tDnh ba2 tD\$c tie9 chuo;i '2 t\$ th chuo;i '2 t\$ \$c a)t tDong au _` " 4, u\$% U num8Ca.atlaba" num 8 .atlab U i39Cnum" .atlab U num8E5 = = 7F num 8 5 = = 7

U i39Cnum" 5 = = 7

U num8aGH/. JKLC 0NKLR+a num 8 GH/. JKLC 0NKLR+ *6' Lenh E"!5 a" Co#ng u\$ng% Hien th* ha2 'ho#ng hien th* @!m! b" Cu 9ha9% 0h\$c hien% GH/I. JKLMC 0NOPQR+ JK/R+ HKT 6B6 +4HS% GH/I. ong lenh ang thi hanh tDong <ile

Khao sat ng dung MATLAB trong ieu khien t ong echo on echo o<< c" +iai th,ch% on% hien th* ong lenh! o<<% 'ho#ng hien th* ong lenh! *8' Lenh @57MAT a" Co#ng u\$ng% :*nh a\$ng 'ieu hien th* cua cac con 3o! Cu 9ha9 boDmat 3hoDt +iai th,ch Hien th* A con ?!7A7c 3o 3au au cham Hien th* 7A ?!7A7BY5cB?BdYXY con 3o 3au au cham Hien th* a\$ng ?BBe7?? 9ha#n 3o cua 9han ngu2e#n nho nhat Hien th* 3o > ng ha2 a#m 4, u\$

boDmat long

boDmat Dat

boDmat >

*9' Lenh !ELP a" Co#ng u\$ng% hng a;n cach 3 u\$ng cac lenh tDong .atlab! b" Cu 9ha9% hel9 hel9 to9ic c" +iai th,ch% hel9% hien th* vafn taft cac mu\$c hng a;n! to9ic% te#n lenh can \$c hng a;n! *:' Lenh !5ME a" Co#ng u\$ng% :em con tDo ve au vung lam viec! b" Cu 9ha9% 0h\$c hien% GH/I. JKLMC 0NOPQR+ JK/R+ HKT 6c6 +4HS% GH/I.

Khao sat ng dung MATLAB trong ieu khien t ong home *;' Lenh LE AT! a" Co#ng u\$ng% 0,nh chieu ai cua vect! b" Cu 9ha9% l 8 length Cx" c" +iai th,ch% l% bien cha chieu ai vect! " 4, u\$% t,nh chieu ai cua vect x! x 8 E= 7 5 ? A B c X d YF l 8 length Cx" l 8 7= U x8E=7 =Y XX,5= =A 5==7 F x8 7 U l8lengthCx" l8 c *<' Lenh L5A/ a" Co#ng u\$ng% Ra\$9 <ile t ^a vao vung lam viec! b" Cu 9ha9% loa loa <ilename loa <ilename loa <iname!exten3ion c" +iai th,ch% 0h\$c hien% GH/I. JKLMC 0NOPQR+ JK/R+ HKT 6X6 +4HS% GH/I. Y XX 5= A 5==7

Khao sat ng dung MATLAB trong ieu khien t ong loa % na\$9 <ile matla9!mat loa <ilename% na\$9 <ile <ilename!mat loa <ilename!exten3ion% na\$9 <ile <ilename!exten3ion 0a9 tin na2 9hai la ta9 tin a\$ng ma tDan co ngh^a la 3o cot cua hang i 9hai bang 3o cot cua hang tDe#n! -et (ua ta \$c mot ma tDan co 3o cot va hang ch,nh la 3o cot va hang cua ta9 tin vaZn ban tDe#n! *=' Lenh L55K@57 a" Co#ng u\$ng% Hien th* tat ca cac lenh co lie#n (uan en to9ic! b" Cu 9ha9% loo'<oD to9ic c" +iai th,ch% to9ic% te#n lenh can \$c hng a;n! 4>' Lenh PA"K a" Co#ng u\$ng% gaf9 xe9 la\$i bo nh tDong vung lam viec! b" Cu 9ha9% 9ac' 9ac' <ilename c" +iai th,ch% Reu nh 'hi 3 u\$ng .atla9 ma2 t,nh xuat hien tho#ng bao hLut o< memoD2i th lenh 9ac' co the tm tha2 mot 3o vung nh con tDong ma 'ho#ng can 9hai xoa bt cac bien! &enh 9ac' giai 9hong 'ho#ng gian bo nh can thiet bang cach nen tho#ng tin tDong vung nh xuong c\$c tieu! 4 .atlab (uan l2 bo nh bang 9hng 9ha9 xe9 chong ne#n cac oa\$n chng tDnh .atlab co the lam cho vung nh b* 9ha#n manh! So o 3e co nhieu vung nh con tDong nhng 'ho#ng u e cha cac bien ln mi! &enh 9ac' 3e th\$c hien% > lu tat ca cac bien le#n ^a tDong mot ta9 tin ta\$m thi la 9ac'!tm9! > xoa tat ca cac bien va ham co tDong bo nh! > la2 la\$i cac bien t ta9 tin 9ac'!tm9! > xoa ta9 tin ta\$m thi 9ac'!tm9! 0h\$c hien% GH/I. JKLMC 0NOPQR+ JK/R+ HKT 6d6 +4HS% GH/I.

Khao sat ng dung MATLAB trong ieu khien t ong 'et (ua la tDong vung nh cac bien \$c go9 la\$i hoa)c nen la\$i toi a ne#n 'ho#ng b* lang 9h, bo nh! Gac'!<iname cho 9he9 cho\$n te#n ta9 tin ta\$m thi e cha cac bien! Reu 'ho#ng ch\ Da te#n ta9 tin ta\$m thi th .atlab t\$ la2 te#n ta9 tin o la 9ac'!tm9! Reu a ung lenh 9ac' ma ma2 va;n con bao thieu bo nh th baft buoc 9hai xoa bt cac bien tDong vung nh i! 4*' Lenh PAT! a" Co#ng u\$ng% 0a\$o ng a;n, liet 'e# tat ca cac ng a;n ang co! b" Cu 9ha9% 9ath 9 8 9ath 9ath C9" c" +iai th,ch% 9ath% liet 'e# tat ca cac ng a;n ang co! 9% bien cha ng a;n! 9ath C9"% a)t ng a;n mi! " 4, u\$% a)t ng a;n en th mu\$c c%jlvtnjmatlab 9 8 _ %jS/jmatlab`k 9ath C9"k 44' Lenh B%&T a" Co#ng u\$ng% 0hoat 'hoi .atlab! b" Cu 9ha9% (uit 46' Lenh +&CE a" Co#ng u\$ng% Cho biet 3o ong va 3o cot cua mot ma tDan! b" Cu 9ha9% 8 3ile Cx" Em,nF 8 3ile Cx" m 8 3ile Cx,7" 0h\$c hien% GH/I. JKLMC 0NOPQR+ JK/R+ HKT 6Y6 +4HS% GH/I.

Khao sat ng dung MATLAB trong ieu khien t ong n 8 3ile Cx,5" c" +iai th,ch% x% te#n ma tDan! % te#n vect co 5 9han t, 9han t th nhat la 3o 9han t con la\$i la 3o cot! m,n% bien m cha 3o ong, bien n cha 3o cot " 4, u\$% ta co ma tDan a x8 B 7 c 5 c ? d A ong,

U x8E7 5 ? A,B c X dF x8 7 5 ? A B c X d

## Cac ba\$n chu 2 ve cach nha9 7 ma tDan% U x8E7 5 ? AkB c X dF

x8 7 B 5 c ? X A d

U 83ileCx" 8 5 A

U m83ileCx,7" m8 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 7= 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong 5 U n83ileCx,5" n8 A U Em,nF83ileCx" m8 5

n8 A 48' Lenh T?PE a" Co#ng u\$ng% Hien th* noi ung cua ta9 tin! b" Cu 9ha9% t29e <ilename c" +iai th,ch% <ilename% te#n <ile can hien th* noi ung! &enh na2 tDnh ba2 ta9 tin \$c ch\ Da! 49' Lenh D!AT a" Co#ng u\$ng% &iet 'e# cac ta9 tin @!m, @!mat, @!mex! b" Cu 9ha9% mhat mhat iDname c" +iai th,ch% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 77 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong mhat% liet 'e# te#n cac ta9 tin !m, !mat, !mex co tDong th mu\$c hien hanh! iDname% te#n th mu\$c can liet 'e#! 4:' Lenh D!&"! a" Co#ng u\$ng% [ac *nh chc naZng cua <unname la ham cua .atlab ha2 ta9 tin! b" Cu 9ha9% mhich <unname c" +iai th,ch% <unname% la te#n lenh tDong .atlab ha2 te#n ta9 tin " 4, u\$% mhich inv inv i3 a buil 6in <unction mhich < c%jmatlabjbinj<!m 4;' Lenh D!5E D!5+ a" Co#ng u\$ng% 0ho#ng tin ve bien ang co tDong bo nh! b" Cu 9ha9% mho mho3 mho global mho3 global c" +iai th,ch% mho% liet 'e# tat ca cac te#n bien ang ton ta\$i tDong bo nh! mho3% liet 'e# te#n bien, ',ch thc, 3o 9han t va xet cac 9han ao co 'hac = 'ho#ng! mho global va mho3% liet 'e# cac bien tDong vung lam viec chung!

6 75 6

+4HS%

Co#ng u\$ng

## *' "a0 toan t soM ho0 ,Arith2eti0 5-erators.) 0oan t > 6 @ !@ j !j

Cong ma tDan hoa)c a\$i l\$ng vo# hng Ccac ma tDan 9hai co cung ',ch thc"! 0D ma tDan hoa)c a\$i l\$ng vo# hng Ccac ma tDan 9hai co cung ',ch thc"! Rha#n ma tDan hoa)c a\$i l\$ng vo# hng Cma tDan 7 9hai co 3o cot bang 3o hang cua ma tDan 5"! Rha#n tng 9han t cua 5 ma tDan hoa)c 5 a\$i l\$ng vo# hng Ccac ma tDan 9hai co cung ',ch thc"! 0h\$c hien chia ng\$c ma tDan hoa)c cac a\$i l\$ng vo# hng C/j1 tng ng vi inv C/"@1"! 0h\$c hien chia ng\$c tng 9han t cua 5 ma tDan hoa)c 5 a\$i l\$ng vo# hng Ccac ma tDan 9hai co cung ',ch thc"! 6 7? 6 +4HS%

## Khao sat ng dung MATLAB trong ieu khien t ong e !e n

!

0h\$c hien chia thuan 5 ma tDan hoa)c a\$i l\$ng vo# hng C/e1 tng ng vi /@invC1""! 0h\$c hien chia thuan tng 9han t cua ma tDan na2 cho ma tDan 'ia Ccac ma tDan 9hai co cung ',ch thc"! &u2 tha ma tDan hoa)c cac a\$i l\$ng vo# hng! &u2 tha tng 9han t ma tDan hoa)c a\$i l\$ng vo# hng Ccac ma tDan 9hai co cung ',ch thc"!

@ v, u\$% Ghe9 t,nh ma tDan 7 x x` x>2 5 ? 75? B c X ? x>5 A B x@2 x`@ 2 A x @ 2` 9he9 toan 3ai ?5 B c x! @ 2` 9he9 toan 3ai 5 x!@ 5 A c A xj2 7ceX x!j 2 Be5 5 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 7A 6 +4HS% d 7= 75 75 7B 7d 5 x@5 A c x! @ 2 x`!@ 2 xo5 xo2 2` 2 Ghe9 t,nh mang A B c A B c 6? 6? 6? 6? 6? 6? A 7= 7d 9he9 toan 3ai

Khao sat ng dung MATLAB trong ieu khien t ong 7e5 5jx 7 ?e5 = xe2 = = xe5 = 7ec = 7e? = 7e5 7e5 7 ?e5 xn2 9he9 toan 3ai x!n 2 x!e 5 x!e 2 5!e x 5 7 5e? 7eA 5eB 7e5 7e5 7 ?e5 7e5 ?5 X5Y 7 xn5 9he9 toan 3ai x!n 5 A Y 5 5nx 9he9 toan 3ai 5!n x A d 4'' Toan t Nuan he ,7e3ationa3 5-erators.) 0oan t p q q8 p8 88 68 Co#ng u\$ng go 3anh nho hn! go 3anh ln hn! go 3anh ln hn hoa)c bang! go 3anh nho hn hoa)c bang! go 3anh bang nhau ca 9han th\$c va 9han ao! go 3anh bang nhau 9han ao!

a" +iai th,ch% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 7B 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong Cac toan t (uan he th\$c hien 3o 3anh tng thanh 9han cua 5 ma tDan! Chung ta\$o Da mot ma tDan co cung ',ch thc vi 5 ma tDan 3o 3anh vi cac 9han t la 7 neu 9he9 3o 3anh la ung va la = neu 9he9 3o 3anh la 3ai! Ghe9 3o 3anh co che o u tie#n 3au 9he9 toan 3o ho\$c nhng tDe#n 9he9 toan logic! b" 4, u\$% th\$c hien 9he9 3o 3anh 3au% U x8B x8 B U xq8E7 5 ?kA B ckX d YF an3 8 7 7 = U x8B x8 B U /8E7 5 ?kA B ckX d YF /8 7 A 5 B ? c 6 7c 6 +4HS% r ta a)t ma tDan / 7 7 = 7 = = r3o 3anh tD\$c tie9 x Cx la B" vi ma tDan r Do Dang cac 9ha t 7,5,?,A,B eu p8 B r au tie#n ta nha9 x8B

## Khao sat ng dung MATLAB trong ieu khien t ong X d Y

U xq8/ an3 8 7 7 = U x8/ x8 7 A X 5 B d ? c Y r 3o 3anh x va / r tat ca cac 9han t eu ung 7 7 7 7 7 7 r cho la\$i x8B 7 7 = 7 = = r ong lenh na2 tc la cho x8 ma tDan /

## U x88/ an3 8 7 7 7 U x8B x8 B U x88/

r 3o 3anh x 8 / 6 7X 6 +4HS%

## 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

Khao sat ng dung MATLAB trong ieu khien t ong an3 8 = = = U xp/ an3 8 = = 7 = = 7 = 7 7 = 7 = = = = r ch\ u2 nhat 9han t B8x Cv x8B"

6' Toan t 3ogig ,Logi0a3 5-erators.) 0oan t s | t Co#ng u\$ng 0h\$c hien 9he9 toan logic /RS! 0h\$c hien 9he9 toan logic LN! 0h\$c hien 9he9 toan logic RL0!

a" +iai th,ch% -et (ua cua 9he9 toan la 7 neu 9he9 logic la ung va la = neu 9he9 logic la 3ai! Ghe9 logic co che o u tie#n tha9 nhat 3o vi 9he9 toan 3o ho\$c va 9he9 toan 3o 3anh! b" 4, u\$% -hi th\$c hien 9he9 toan ?qA s 7> th ma2 t,nh 3e th\$c hien 7>5 \$c ?, 3au o ti ?qA \$c = Doi th\$c hien = s ? va cuoi cung ta \$c 'et (ua la =! 8' K( t aO0 Piet ,+-e0ia3 "hara0ters.) 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 7d 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong -2 hieu EF C" 8 _ ! , k r u Co#ng u\$ng -hai bao vectoD hoa)c ma tDan! 0h\$c hien 9he9 toan u tie#n, 'hai bao cac bien va cac ch\ 3o cua vectoD! 0h\$c hien 9he9 gan! Chu2en v* ma tDan tm l\$ng lie#n hie9 cua 3o 9hc! :iem cham tha9 9ha#n! Gha#n biet cac 9han t cua ma tDan va cac oi 3o tDong ong lenh! RgaZn cach gia cac hang 'hi 'hai bao ma tDan! 0ho#ng bao ong chu th,ch! . ca 3o .g o SLg!

9' daMu Q)R a" Co#ng u\$ng% 0a\$o vectoD hoa)c ma tDan 9hu\$ va la)9 i la)9 la\$i cac gia tD*! b" +iai th,ch% -hai bao v%' v%i%' /C% , v" /Ci , %" /C% , %" /Cv , '" /C% , v , '" /C%" c" 4, u\$% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 7Y 6 +4HS% Co#ng u\$ng 0a\$o Da chuo;i v, v>7, v>5,w!, '67, ' 0a\$o Da chuo;i v, v>i, v>5W,w!,'6i, ' Ch\ cot th v cua ma tDan / Ch\ hang th i cua ma tDan Ch\ toan bo ma tDan / Ch\ 9han t /Cv", /Cv>7"w/C'" Ch\ cac 9han t /C%, v", /C%, v>7"w /C%, '" Ch\ tat ca cac thanh 9han cua ma tDan /

Khao sat ng dung MATLAB trong ieu khien t ong 'hi 'hai bao S 8 7 % 7= ta \$c 'et (ua% S 8 7 5 ? A B c X d Y 7= con 'hi 'hai bao S 8 = % 5 %7= th ta \$c 'et (ua% S 8 = 5 A c d 7=

## &&&' "AF" !AIM L5A&" ,L5A&"AL @% "T&5 .

*' Lenh ALL a" Co#ng u\$ng% -iem tDa vectoD ha2 ma tDan co gia tD* = ha2 'ho#ng! b" Cu 9ha9% 2 8 allCx" c" +iai th,ch% 2% bien cha 'et (ua x% te#n ve toD ha2 ma tDan 2 8 7 'hi tat ca cac 9han t 'hac = 2 8 = 'hi co 7 9han t bang = " 4, u\$% U a8E7 5 ?F a8 7 5 ? 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

6 5= 6

+4HS%

Khao sat ng dung MATLAB trong ieu khien t ong U 28allCa" 28 7 U a8E7 = ?F a8 7 = ?

## U 28allCa" 28 = U a8E7 5 ?kA = ckX d YF a8 7 A X 5 = d ? c Y

U 28allCa" 28 7 = 7

## 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

6 57 6

+4HS%

Khao sat ng dung MATLAB trong ieu khien t ong U a8E7 5 =k= ? Bk5 c dF a8 7 = 5 5 ? c = B d

U 28allCa" 28 = 7 =

4' Lenh A ? a" Co#ng u\$ng% -iem tDa vectoD ha2 ma tDan co gia tD* 'hac = ha2 'ho#ng! b" Cu 9ha9% 2 8 an2Cx" c" +iai th,ch% 2% bien cha 'et (ua! x% te#n vectoD, ha2 ma tDan! 2 8 7 'hi co 7 9han t 'hac =! 2 8 = 'hi co 7 9han t bang =! " 4, u\$% U a8E7 5 ?Fk U 28an2Ca" 28 7 U b8E7 = ? =Fk U 28an2Cb" 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 55 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong 28 7 U c8E7 5 = Ak= 5 = Ak7 5 ? Ak? A B cF c8 7 = 7 ? 5 5 5 A = = ? B A A A c

U 28an2Cc" 28 7 7 7 7

U 8E= = = =k= 7 ? =F 8 = = = 7 = ? = =

U 28an2C " 28 = 7 7 =

6' Lenh ES&+T 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 5? 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong a" Co#ng u\$ng% -iem tDa bien ha2 <ile co ton ta\$i ha2 'ho#ng! b" Cu 9ha9% e 8 exi3tC_item`" c" +iai th,ch% item% la te#n <ile ha2 te#n bien! e% bien cha gia tD* tDa ve! e = 7 5 ? A B T ngh^a item 'ho#ng ton ta\$i tDong vung lam viec item la bien ang ton ta\$i tDong vung lam viec item ang ton ta\$i tDe#n ^a Cch\ 'iem tDa tDong th mu\$c hien hanh" item la .x[6<ile item la <ile \$c *ch t 9han mem gimulin' item la ham cua .atlab

" 4, u\$% e 8 exi3tC_ iD`" e8B 8' Lenh @& / a" Co#ng u\$ng% 0m 9han t tDong vectoD ha2 ma tDan theo 2e#u cau! b" Cu 9ha9% ' 8 <in Cx" Ei,vF 8 <in Cx" Ei,v,3F 8 <in Cx" c" +iai th,ch% '% ch\ v* tD, cua 9han t can tm tDong vectoD! i,v% ch\ 3o hang va 3o cot tng ng cua 9han t can tm! 3% cha gia tD* cua 9han t can tm! x% te#n vectoD, ma tDan ha2 la 2e#u cau e Da! Reu 'ho#ng ne#u Da 2e#u cau th ma)c nhie#n la tm cac 9han t 'hac =! " 4, u\$% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 5A 6 +4HS%

## U '8<in Cx" '8 7 5 A B

U '8E? cF '8 ? c

U a8EB = =kd = ?F a8 B d = = = ?

U Ei,v,'F8<in Ca" i8 7 5 5

6 5B 6

+4HS%

&H'

## !5FM LE ! LAP T7T ! T75 A MATLAB

*' Lenh EHAL a" Co#ng u\$ng% Chu2en oi chuo;i '2 t\$ thanh bieu thc! b" Cu 9ha9% '( 8 evalC_3tDing`" c" +iai th,ch% '(% bien cha 'et (ua! Reu _3tDing` la cac '2 3o th chu2en thanh nhng con 3o! Reu _3tDing` la ca#u lenh th chu2en thanh cac lenh thi hanh \$c! " 4, u\$% U a8a7YYYYYYYYak U evalCa">7 an3 8

## 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

6 5c 6

+4HS%

Khao sat ng dung MATLAB trong ieu khien t ong 5======== 4' Lenh @57 a" Co#ng u\$ng% Sung e th\$c hien 7 co#ng viec can la)9 i la)9 la\$i theo mot (u2 luat, vi 3o bc la)9 xac *nh tDc! b" Cu 9ha9% <oD bien ieu 'hien 8 gia tD* au % gia tD* cuoi, th\$c hien co#ng vieck en c" +iai th,ch% Co#ng viec ch,nh la cac lenh can thi hanh, co the co nhieu lenh, 'et thuc lenh 9hai co auk " 4, u\$% Wn Da man hnh B ong _GH/. JKLC 0NKLR+ chao cac ban`! <oD i 8 7%B, i39C_GH/. JKLC 0NKLR+ chao cac ban`"k en GH/. JKLC 0NKLR+ chao cac ban GH/. JKLC 0NKLR+ chao cac ban GH/. JKLC 0NKLR+ chao cac ban GH/. JKLC 0NKLR+ chao cac ban GH/. JKLC 0NKLR+ chao cac ban 6' Lenh @% "T&5 a" Co#ng u\$ng% 0a\$o the#m ham mi! b" Cu 9ha9% <unction 3 8 nCx" c" +iai th,ch% 3% te#n bien cha gia tD* tDa ve 3au 'hi thi hanh ham! n% te#n g\$i nh! " 4, u\$% C 9han la9 tDong .!<ile" 8' Lenh & P%T a" Co#ng u\$ng% Sung e nha9 vao 7 gia tD*! 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 5X 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong b" Cu 9ha9% te#n bien 8 in9ut C_9Domt`" te#n bien 8 in9ut C_9Domt`, _3`" c" +iai th,ch% te#n bien, la ni lu gia tD* nga9 vao! _9Domt`% chuo;i '2 t\$ muon nha9 vao! _3`% cho biet gia tD* nha9 vao la nhieu '2 t\$! " 4, u\$7% x 8 in9utC_nha9 gia tD* cua bien x% `" nha9 gia tD* cua bien x% B x8B e" 4, u\$5% tDayli 8 in9utC_ba\$n co muon tie9 tu\$c 'ho#ng z `,`3`" ba\$n co muon tie9 tu\$c 'ho#ng z 'ho#ng tDayli 8 'ho#ng 9' Lenh &@ UEL+E&@ UEL+E a" Co#ng u\$ng% 0h\$c hien lenh 'hi thoa ieu 'ien! b" Cu 9ha9% i< bieu thc luan l2 7 th\$c hien co#ng viec 7k el3ei< bieu thc luan l2 5 th\$c hien co#ng viec 5k el3e th\$c hien co#ng viec ?k en c" +iai th,ch% -hi bieu thc luan '2 7 ung th th\$c hien co#ng viec 7 tng t\$ cho bieu thc luan l2 5! Reu ca hai bieu thc 3ai th th\$c hien co#ng viec 3au lenh el3e! 1ieu thc luan l2 la cac 9he9 3o 3anh 88, p, q, p8, q8 co#ng viec ch,nh la cac lenh can thi hanh, co the co nhieu lenh, 'et thuc lenh 9hai co au k 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 5d 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong " 4, u\$% 4iet chng tDnh nha9 vao 5 3o va 3o 3anh hai 3o o! a 8 in9utC_Rha9 a% `"k b 8 in9utC_Rha9 b% `"k i< a q b i39C_a ln hn b`"k el3ei< a 88b i39C_a bang b`"k el3e i39C_a nho hn b`"k en nha9 a% A nha9 b% B a nho hn b :' Lenh ME % a" Co#ng u\$ng% 0a\$o menu e cho\$n chc naZng! b" Cu 9ha9% te#n bien 8 menu C_0e#n menu`,_chc naZng7`,_chc naZng5`, w! , _chc naZng n`" c" +iai th,ch% te#n menu% la tie#u e cua menu! te#n bien% la ni cat gia tD* nhan \$c 3au 'hi cho\$n chc naZng cua menu! Chc naZng 7, 5, w!,n%'hi cho\$n chc naZng nao th te#n bien co gia tD* la 3o th t\$ cua chc naZng o! " 4, u\$% ' 8 menuC_Choo3e a coloD`, _Ne `, _1lue`, _+Deen`" 6666 Choo3e a coloD 6666 7" Ne 5" 1lue ?" +Deen ;' Lenh PA%+E a" Co#ng u\$ng% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 5Y 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong Sng chng tDnh theo 2 muon! b" Cu 9ha9% 9au3e on 9au3e o<< 9au3e Cn" c" +iai th,ch% 9au3e on% ng chng tDnh, va ch nhan 7 9h,m bat '2 CtD cac 9h,m ieu 'hien" chng tDnh th\$c hien tie9! 9au3e o<<% taft chc naZng 9au3e! 9au3e Cn"% ng chng tDnh ta\$i n gia#2! " 4, u\$% <oD n 8 7 % ?k i39C_GDe33 an2 'e2 to continuew`" 9au3e en GDe33 an2 'e2 to continuew GDe33 an2 'e2 to continuew GDe33 an2 'e2 to continuew <' Lenh D!&LE a" Co#ng u\$ng% Sung e th\$c hien 7 co#ng viec can la)9 i la)9 la\$i theo mot (u2 luat, vi 3o bc la)9 'ho#ng xac *nh, 9hu\$ thuoc vao bieu thc luan l2! b" Cu 9ha9% mhile bieu thc luan l2 th\$c hien co#ng vieck en c" +iai th,ch% 1ieu thc luan l2 la cac 9he9 3o 3anh 8 8, p, q, p8, q8 Co#ng viec ch,nh la cac lenh can thi hanh, co the co nhieu lenh, 'et thuc lenh 9hai co au k -hi th\$c hien xong co#ng viec th (ua2 le#n 'iem tDa la\$i bieu thc luan l2, neu va;n con ung th tie9 tu\$c th\$c hien, neu 3ai th 'et thuc! " 4, u\$% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 ?= 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong t,nh tong / 8 7>7e5>7e?>w>7en n 8 in9utC_nha9 vao 3o n `"k a 8 =k i 8 7 mhile i p8 n a 8 a > 7ei i 8 i > 7k en i39C_'et (ua`"k i39Ca"k nha9 vao 3o n ? 'et (ua 7!d??? B*,BT8a.) 4iet chng tDnh nha9 vao mot 3o nCnq8=" vi cac tDng h\$9 3au% a" Reu np= th in tho#ng bao ba\$n nha9 3ai b" Reu nq= va le th t,nh tong 3787>?>B>!!!>n,n la 3o le! c" Reu nq= va cha]n th 3585>A>c>!!!>n,n cha]n! " Reu n8= ng chng tDnh la\$i!
% BT4a: Viet chuong trinh nhap vao mot so n(n>=0) % voi cac truong hop sau: % a) Neu n<0 thi in thong bao ban nhap sai % b) Neu n>0 va le thi tinh tong s = !"!#!\$\$\$!n%n la so le\$ % c) Neu n>0 va chan thi s&=&!4!'!\$\$\$!n%n chan\$ % () Neu n=0 (ung chuong trinh lai\$ n=input()nhap n= ))* %nhap so n (u=rem(n%&)* %+iem tra n la le ha, chan %neu n le (u= % n chan (u=0 i- n<0 -print-()Ban nhap sai)) %.uat ra thong bao en( i- (n>0) / ((u== ) %neu n>0 va le i= * %gan i= * s = * %gan tong s = 0hile i<n %thuc hien vong lap i=i!&* %tang i len & sau moi lan lap s =s !i* %tinh tong s voi gia tri i moi en( s %in ra +et 1ua sau +hi +et thuc vong lap en( i- (n>0) / ((u==0) i=0* s&=0* 0hile i<n i=i!&* s&=s&!i* en(

6 ?7 6

+4HS%

## Khao sat ng dung MATLAB trong ieu khien t ong

s& en( i- n==0 brea+ en( %neu n=0 %lenh +et thuc

## -hi cha\$2 chng tDnh%

2 nhap n= # s = 3 2 BT4a nhap n= 4 s& = ' 2 BT4a nhap n= 4' Ban nhap sai2 BT4a nhap n= 0 2

## H' TAP LE ! SG\$ L?F "!%5V&

*' Lenh AB+ a" Co#ng u\$ng% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 ?5 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong 0a\$o vectoD n co gia tD* cua mo;i 9han t la 3o th t\$ tng ng vi '2 t\$ tDong bang ma /gCWW! &a2 tD* tu2et oi cua mot 3o a#m! b" Cu 9ha9% n 8 /1gC3" x 8 /1gCa" c" +iai th,ch% n% te#n vectoD! 3% chuo;i '2 t\$, hoa)c la te#n bien cha chuo;i '2 t\$! a% 3o a#m, hoa)c la te#n bien cha 3o a#m! x% tD* tu2et oi cua a! " 4, u\$% U n8ab3CaGH/. JKLC 0NKLR+a" n8 Column3 7 thDough 75 d= X5 cB XX ?5 d7 dB XY cX ?5 dA d5

Column3 7? thDough 7c dB XY Xd X7

U m8ab3Ca./0&/1a" m8 XX cB dA Xc cB cc

U K8ab3Caabca" K8 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 ?? 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong YX Yd YY U 08ab3C67" 08 7 4' Lenh BLA K+ a" Co#ng u\$ng% 0a\$o 'hoang tDafng gia hai ha2 nhieu chuo;i '2 t\$ theo mong muon! b" Cu 9ha9% Eg7 1&/R-gCb7" g5 1&/R-gCb5" w1&/R-gCbn" gnF c" +iai th,ch% g7, g5, wgn% cac chuo;i '2 t\$! b7, b5% 3o 'hoang tDafng! " 4, u\$% Wn A chuo;i _-hao 3at`,_ng u\$ng`, _./0&/1`, _tDong ieu 'hien t\$ ong` Da man hnh vi 'hoang cach lan l\$t gia A chuo;i la% 5,A,? U g8Ea-hao 3atablan'3C5" aung ungablan'3CA" a./0&/1ablan'3C?" atDong ieu 'hien tu ongaF g8 -hao 3at ung ung 6' Lenh /E"4!ES a" Co#ng u\$ng% :oi con 3o cua he 7= 3ang he 7c! b" Cu 9ha9% 3 8 ec5hexCn" c" +iai th,ch% 3% bien cha chuo;i '2 3o cua he 7c n% con 3o ngu2e#n he 7=! " 4, u\$% 3 8 ec5hexC7=" 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 ?A 6 +4HS% ./0&/1 tDong ieu 'hien tu ong

Khao sat ng dung MATLAB trong ieu khien t ong 3 8 _/` 8' Lenh !ES4/E" a" Co#ng u\$ng% :oi chuo;i '2 3o cua he 7c 3ang con 3o cua he 7=! b" Cu 9ha9% n 8 hex5 ecC_3`" c" +iai th,ch% n% con 3o cua he 7=! 3% chuo;i '2 3o he 7c! " 4, u\$% n 8 hex5 ecC_/`" n 8 7= 9' Lenh & T4+T7 a" Co#ng u\$ng% Chu2en 3o ngu2e#n 3ang a\$ng chuo;i! Chu2en cac '2 t\$ tDong mot chuo;i 3ang 3o th t\$ tng ng tDong bang ma /gCWW! b" Cu 9ha9% '( 8 WR0 c" +iai th,ch% '(% bien g0NCn"cha 'et (ua! n% te#n bien can chu2en! Reu n la 3o ngu2e#n th '( la chuo;i '2 3o! Reu n la chuo;i '2 t\$ th '( la 3o tng ng tDong bang ma /gCWW " 4, u\$% U n8a./0&/1a n8 ./0&/1 U t8int53tDCn" 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 ?B 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong t8 XX cB dA Xc cB cc U n85==7 n8 5==7 U t8int53tDCn" t8 5==7 :' Lenh &++T7 a" Co#ng u\$ng% -iem tDa noi ung bien co 9hai la chuo;i '2 t\$ 'ho#ng! b" Cu 9ha9% '( 8 i33tDCn" c" +iai th,ch% '(% bien cha 'et (ua! n% te#n bien can 'iem tDa! '( 8 7 neu n la chuo;i '2 t\$! = neu n 'ho#ng la chuo;i '2 t\$! " 4, u\$% U n8a./0&/1ak U '(8i33tDCn" '( 8 7 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 ?c 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong U m8E7 5 ? AFk U '(8i33tDCm" '( 8 = ;' Lenh L5DE7 a" Co#ng u\$ng% Cho Da chuo;i '2 t\$ viet thng! b" Cu 9ha9% b 8 lomeDC3" c" +iai th,ch% b% bien cha 'et (ua! 3% te#n bien cha chuo;i '2 t\$ ha2 chuo;i '2 t\$! " 4, u\$% U a8aSL /R cua 9H/m (uLC 0NuLn+ak U b8lomeDCa" b8 o an cua 9ham (uoc tDuong <' Lenh %M4+T7 a" Co#ng u\$ng% Chu2e;n 3o th\$c 3ang a\$ng chuo;i! Chu2en cac '2 t\$ tDong mot chuo;i 3ang 3o th t\$ tng ng tDong bang ma /gCWW! b" Cu 9ha9% '( 8 num5tDCn" c" +iai th,ch% '(% bien cha 'et (ua! n% te#n bien can chu2en! Reu n la 3o th\$c th '( la 3o tng ng tDong bang ma /gCWW! " 4, u\$% U n8?!7A7ck 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 ?X 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong U '(8num53tDCn" '( 8 ?!7A7c =' Lenh +ET+T7 a" Co#ng u\$ng% Cho Da '2 t\$ tng ng vi 3o th t\$ tDong bang ma /gCWW! b" Cu 9ha9% x 8 get gtDCn" c" +iai th,ch% x% bien cha '2 t\$ tng ng Cthuoc bang ma /gCWW"! n% 3o ngu2e#n C= n 5BB"! " 4, u\$% 0m '2 t\$ co 3o th t\$ la cB tDong bang ma /gCWW! U 't83et3tDCcB" 't 8 / *>' Lenh +T74MAT a" Co#ng u\$ng% 0a\$o ma tDan co cac 9han t a\$ng chuo;i! b" Cu 9ha9% 3 8 3tD5matC_37`, _35`, w" c" +iai th,ch% 3% te#n ma tDan 'et (ua! 37, 35% chuo;i '2 t\$! " 4, u\$% 3 8 3tD5matC_mat`, _lab`" 38 mat lab 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 ?d 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong **' Lenh +T74 %M a" Co#ng u\$ng% Chu2en chuo;i C a\$ng 3o" 3ang 3o th\$c! b" Cu 9ha9% n 8 3tD5numC3" c" +iai th,ch% 3% chuo;i a\$ng 3o! n% 3o th\$c! " 4, u\$% n 8 3tD5numC_ABcABc`" n 8 ABcABc *4' Lenh +T7"MP a" Co#ng u\$ng% go 3anh 5 chuo;i '2 t\$! b" Cu 9ha9% l 8 3tDcm9C37, 35" c" +iai th,ch% l% bien cha 'et (ua! 37, 35% chuo;i can 3o 3anh! " 4, u\$% a 8 _.at&ab VoN'g` b 8 _.at&ab VoN'g` 3tDcm9Ca,b" an3 8 7 *6' Lenh %PPE7 a" Co#ng u\$ng% Cho Da chuo;i viet hoa! b" Cu 9ha9% b 8 u99eD c" +iai th,ch% b% bien cha 'et (ua! 3% te#n bien cha chuo;i '2 t\$! " 4, u\$% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 ?Y 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong a 8 _.a0lab VLN'3` b 8 u99eDCa" b 8 ./0&/1 b 8 u99eDC_.a0lab VLN'3`" b8 ./0&/1 VLN-g

## H&' "AF" !AIM A&A5 T&EWP

*' Lenh @"L5+E a" Co#ng u\$ng% :ong <ile ang m 3au 'hi tDu2 xuat xong! b" Cu 9ha9% <clo3eC<i " c" +iai th,ch% <i % te#n bien tDo en <ile ang m! 4' Lenh @5PE a" Co#ng u\$ng% . <ile hoa)c tDu2 xuat lieu cua <ile ang m! b" Cu 9ha9% <i 8 <o9enC_<n`" <i 8 <o9enC_<n`, _9`" c" +iai th,ch% <i % te#n bien tDo en <ile ang m! <n% te#n <ile Cco the a)t ng a;n"! 0ham 3o 9 co cac *nh a\$ng 3au% _D`% ch\ o\$c! _D>`% o\$c va ghi! _m`% xoa tat ca noi <ile o e ghi! ung cua <ile hoa)c ta\$o 7 <ile mi va m

_m>`% xoa tat ca noi ung cua <ile hoa)c ta\$o 7 <ile mi va m <ile o e ghi va o\$c! 6' Lenh @P7& T@ a" Co#ng u\$ng% +hi oa\$n lieu thanh <ile! 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 A= 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong b" Cu 9ha9% <9Dint<C<i , <" c" +iai th,ch% <i % te#n bien tDo en <ile can ghi! <% cac tham 3o e *nh a\$ng! " 4, u\$% 0a\$o <ile ex9!txt co noi ung% x 8 =%5%7=k 2 8 Ex, xe5Fk <i 8 <o9enC_ex9!txt`, _m`"k <9Dint<C<i , _r `, E5, in<F"k +an <ile ex9!txt va bien a e xem noi ung% <i 8 <o9enC_ex9!txt`" a 8 <3can<C<i , _r `, E5,in<F"k i39Ca"k <clo3eC<i "k -et (ua = = 8' Lenh @7EA/ a" Co#ng u\$ng% :o\$c lieu a\$ng nh* 9ha#n t <ile! b" Cu 9ha9% Ea, cF 8<3can<C<i " Ea, cF 8 <3can<C<i ,3" c" +iai th,ch% a% te#n bien cha liec \$c o\$c vao! c% 3o 9han t \$c o\$c vao! <i % te#n bien tDo en <ile can o\$c! 3% ',ch thc lieu o\$c vao! 3 \$c *nh a\$ng bi cac tho#ng 3o% n% ch\ o\$c n 9han t vao cot vectoD a! in<% o\$c en het <ile! 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 A7 6 +4HS% 5 7 A 5 c ? d A 7= B

Khao sat ng dung MATLAB trong ieu khien t ong Em,nF% ch\ o\$c vao m cot va n hang, n co the bang in< con m th 'ho#ng! " 4, u\$7% <ile v !txt co noi ung% /1C 7 5 ? <i 8 <o9enCv !txt`"k Ea,cF 8 <Dea C<i "k i39Ca"k i39Cc"k a8 cB ?5 cc ?5 cX 7? 7= AY ?5 B= ?5 B7 c8 75 e" 4, u\$5 <i 8 <o9enC_v 7!txt`"k Ea,cF 8 <Dea C<i , A"k i39Ca"k i39Cc"k a8 cB ?5 cc 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 A5 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong ?5 c8 A <" 4, u\$ ?% <ile v ?!txt co noi ung /1CSx b+HW{ -&.RL <i 8 <o9enC_v ?!txt`"k Ea,cF 8 <Dea C<i , EX, in<F"k i39Ca"k i39Cc"k a8 cB X= XB cc X7 Xc cX X5 Xc cd X? Xd cY XA XY 7? 7? 7? 7= 7= 7= c8 57 a`8 cB cc cX cd cY 7? 7= X= X7 X5 X? XA 7? 7= XB Xc XX Xd XY 7? 7= 9' Lenh @D7&TE a" Co#ng u\$ng% +hi oa\$n lieu a\$ng nh* 9ha#n thanh <ile! b" Cu 9ha9% <mDite C<i ,a" c" +iai th,ch% <i % te#n bien tDo en <ile can ghi! 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 A? 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong a% te#n bien cha lieu! " 4, u\$% +hi oa\$n lieu cua bien a thanh <ile a!txt a 8 EcB cc cXF <i 8 <o9enC_a!txt`, _m`"k <mDiteC<i , _r`"k <miteC<i ,a"k +an <ile a!txt vao bien b e xem noi ung <i 8 <o9enC_a!txt`"k b 8 <3can<C<i , _r`"k i39Cb"k <clo3eC<i "k -et (ua b 8 /1C :' Lenh +P7& T@ a" Co#ng u\$ng% Hien th* tho#ng tin le#n man hnh! b" Cu 9ha9% 3 8 39Dint<C_t3`, 3" c" +iai th,ch% 3% bien cha chuo;i 3o hien th* tDe#n man hnh! t3% cac tham 3o *nh a\$ng! 3% anh 3ach cac oi 3o! 0ham 3o *nh a\$ng thuoc 7 tDong 5 'ieu 3au% C7" Chuo;i '2 t\$% chuo;i na2 3e \$c hien th* le#n man hnh giong het nh \$c viet tDong ca#u lenh! C5" Chuo;i cac tham 3o *nh a\$ng% cac chuo;i na2 3e 'ho#ng \$c hien th* le#n man hnh, nhng tac u\$ng ieu 'hien viec chu2en oi va cach hien th* cac oi 3o \$c a Da tDong anh 3ach cac oi 3o! 4, u\$ cac tham 3o *nh a\$ng% 7" r % oi 3o la 3o ngu2e#n \$c viet i a\$ng tha9 9ha#n! 3 8 39Dint<C_:a#2 la 3o% r `,65A" 3 8 :a#2 la 3o% 65 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 AA 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong 5" ru% oi 3o la 3o ngu2e#n \$c viet i a\$ng tha9 9ha#n 'ho#ng au! 3 8 39Dint<C_:a#2 la 3o% ru`,5A" 3 8 :a#2 la 3o% 5A ?" ro% oi 3o la 3o ngu2e#n \$c viet 'ho#ng au! 3 8 39Dint<C_:a#2 la 3o% ro`,Y" 3 8 :a#2 la 3o% 77 A" rx% oi 3o la 3o ngu2e#n \$c viet i a\$ng c 3o 7c! 3 8 39Dint<C_:a#2 la 3o% rx`,5BB" 3 8 :a#2 la 3o%<< B" r<% oi 3o la 3o ngu2e#n \$c viet i a\$ng c9 3o 7=! 3 8 39Dint<C_:a#2 la 3o% r<`,5BB= 3 8 :a#2 la 3o% 5BB!====== :e *nh a\$ng 9han tha9 9ha#n th the#m vao con 3o cha 3o tha9 9ha#n can la2! 3 8 39Dint<C_:a#2 la 3o% r!?<`, 5!BBcd" 3 8 :a#2 la 3o% 5!BBX c" rc% oi 3o la 7 '2 t\$ Die#ng a)c biet! 3 8 39Dint<C_:a#2 la ch% rc`,`.`" 3 8 :a#2 la ch% . X"r3% oi 3o la chuo;i '2 t\$! 3 8 39Dint<C_:a#2 la chuo;i% r3`, _.atlab`" 3 8 :a#2 la chuo;i% .atlab <' Lenh ++"A @ a" Co#ng u\$ng% :o\$c chuo;i '2 t\$ va *nh a\$ng la\$i chuo;i '2 t\$ o! b" Cu 9ha9% Ea,countF 8 33can<C3, _<oDmat`, 3ile" c" +iai th,ch% a% te#n bien cha chuo;i '2 t\$ 3au 'hi \$c *nh a\$ng! count% em 3o 9han t \$c o\$c vao! 3ile% ',ch thc 3e \$c o\$c vao! <oDmat% 9han *nh a\$ng giong nh lenh 39Dint<! 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 AB 6 +4HS% i a\$ng c 3o d

Khao sat ng dung MATLAB trong ieu khien t ong " 4, u\$% 3 8 _?!75 7!5 =!5? 5!Bc`k Ea, countF 8 33can<C3, _r<`,?" a8 ?!75== 7!5=== =!5?== count 8 ?

## H&&' "AF" !AIM T5AF

*! Mot soM haX2 3Yng gia0) a" Cu 9ha9% '( 8 hlgCx" b" +iai th,ch% '(% te#n bien cha 'et (ua! x% n v* Da ian! hlg% te#n ham l\$ng giac! 0e#n ham l\$ng giac 3in co3 tan a3in atan 3inh co3h tanh +iai th,ch 0,nh gia tD* 3ine 0,nh gia tD* co3ine 0,nh gia tD* tangent Rgh*ch ao cua 3ine

## !5J" "# BA\$

Rgh*ch ao cua tangent 0,nh gia tD* h29eDbolic 3ine 0,nh gia tD* h29eDbolic co3ine 0,nh g,a tD* h29eDbolic tangent

4! Lenh A ALE a" Co#ng u\$ng% 0,nh goc 9ha cua 3o 9hc! b" Cu 9ha9% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 Ac 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong 9 8 angleCl" c" +iai th,ch% 9% te#n bien cha 'et (ua, n v* Da ian3 l% 3o 9hc " 4, u\$% l 8 i6?v l 8 = o 5!====i 9 8 angleCl" 9 8 67!BX=d 6! Lenh "E&L a" Co#ng u\$ng% &am tDon 3o ve 9h,a 3o ngu2e#n ln hn! b" Cu 9ha9% 2 8 ceilCx" c" +iai th,ch% 2% 3o 3au 'hi \$c lam tDon! x% 3o can \$c lam tDon! " 4, u\$% x 8 67!Y=== 2 8 ceilCx" 2 8 67 = 8! Lenh "5 Z a" Co#ng u\$ng% 0,nh l\$ng lie#n hie9 cua 3o 9hc! b" Cu 9ha9% 2 8 convCl" c" +iai th,ch% 2% te#n bien cha l\$ng lie#n hie9 l% 3o 9hc " 4, u\$% l 8 6?i > 5v l 8 = o 7!====i 2 8 convCl" 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 AX 6 +4HS% A c X 6=!5=== ?!A=== B!c=== X!====

Khao sat ng dung MATLAB trong ieu khien t ong 2 8 = > 7!====i 9! Lenh ESP a" Co#ng u\$ng% 0,nh gia tD* ex! b" Cu 9ha9% 2 8 ex9Cx" c" 4, u\$% 2 8 ex9Cx" 2 8 5=!=dBB :! Lenh @&S a" Co#ng u\$ng% &am tDon 3o ve 9h,a leDo! b" Cu 9ha9% 2 8 <ixCx" c" +iai th,ch% 2% 3o 3au 'hi \$c lam tDon! x% 3o can \$c lam tDon! " 4, u\$% x 8 67!Y=== 2 8 <ixCx" 2 8 67 = ;! Lenh @L557 a" Co#ng u\$ng% &am tDon 3o ve 9h,a 3o ngu2e#n nho hn! b" Cu 9ha9% 2 8 <looDCx" c" +iai th,ch% 2% 3o 3au 'hi \$c lam tDon ! x% 3o can \$c lam tDon " 4, u\$% x 8 67!Y=== 2 8 <looDCx" 2 8 65 67 ? B X 6 Ad 6 +4HS% 6=!5=== ?!A=== B!c=== X!==== ? B X 6=!5=== ?!A=== B!c=== X!====

## 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

Khao sat ng dung MATLAB trong ieu khien t ong <! Lenh &MAA a" Co#ng u\$ng% &a2 9han ao cua 3o 9hc! b" Cu 9ha9% 2 8 imagCl" c" 4, u\$% 2 8 imagC5 > ?v" 28? =! Lenh L5A a" Co#ng u\$ng% 0m logaDithm c 3o e! b" Cu 9ha9% 2 8 logCx" " 4, u\$% 2 8 logC5!X7d" 2 8 =!YYYY *>! Lenh L5A4 a" Co#ng u\$ng% 0m logaDithm c 3o 5! b" Cu 9ha9% 2 8 log5Cx" " 4, u\$% 2 8 log5C5" 287 **! Lenh L5A*> a" Co#ng u\$ng% 0m logaDithm c 3o 7=! b" Cu 9ha9% 2 8 log7=Cx" " 4, u\$% 2 8 log7=C7=" 287 *4! Lenh 7EAL 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 AY 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong a" Co#ng u\$ng% &a2 9han th\$c cua 3o 9hc! b" Cu 9ha9% 2 8 DealCl" " 4, u\$% 2 8 DealC7 > ?v" 285 *6! Lenh 7EM a" Co#ng u\$ng% Cho 9han cua 9he9 chia! b" Cu 9ha9% D 8 DemCa,b" c" +iai th,ch% D% bien cha 'et (ua a, b% 3o chia va 3o b* chia " 4, u\$% D 8 DemC7c, ?" D87 *8! Lenh 75% / a" Co#ng u\$ng% &am tDon 3o 3ao cho gan 3o ngu2e#n nhat! b" Cu 9ha9% 2 8 Doun Cx" c" 4, u\$% x 8 67!Y=== 2 8 Doun Cx" 28 65 = [ ceilCx" <looDCx" <ixCx" Doun Cx" ? c X ?!A=== A ? ? ? B!c=== c B B c 6 B= 6 X!==== X X X X +4HS% 1ang 3o 3anh cua cac 9he9 lam tDon 3o 67!Y=== 67 65 67 65 6=!5=== = 67 = = 6=!5=== ?!A=== B!c=== X!====

## 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

Khao sat ng dung MATLAB trong ieu khien t ong *9! Lenh +&A a" Co#ng u\$ng% [et au 3o th\$c! b" Cu 9ha9% 2 8 3ignCx" c" +iai th,ch% x% 3o th\$c can xet au! 2% 'et (ua tDa ve! 2 = 7 67 " 4, u\$% x8 5 = 28 7 6? =!B = 67 7 2 8 3ugnCx" *:! Lenh +B7T a" Co#ng u\$ng% 0,nh caZn bac hai! b" Cu 9ha9% 2 8 3(DtCx" c" 4, u\$% x8A 2 8 3(DtCx" 285 x 3o = 3o ng 3o a#m

## H&&&' TAP LE ! T!A5 TAF" T7E[ T7A

0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 B7 6

MA

*' "ongE trXE nha\nE 0hia tXng -han t 0ua 2a tran ]Yi ha^ng soM +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong a" Cu 9ha9% .a tDan 'et (ua 8 ma tDan E>F E6F E!F EeF hang 3o! b" 4, u\$% a8 7 A X 5 B d ? c Y

## Cong ma tDan a vi 5 'et (ua la ma tDan b b8a>5 b8 ? c Y A X B d

7= 77

tng t\$ cho cac 9he9 t,nh tD, nha#n va chia! 4! Lenh /ET a" Co#ng u\$ng% Sung e t,nh *nh thc cua ma tDan! b" 4, u\$% 0,nh *nh thc cua ma tDan a a8 7 A B etCa" an3 8 6d 6! Lenh /&AA a" Co#ng u\$ng% 0a\$o ma tDan mi va x l2 ng cheo theo (u2 c! b" Cu 9ha9% v 8 iagCx" v 8 iagCx,'" c" +iai th,ch% x% la vectoD co n 9han t! v% la ma tDan \$c ta\$o Da t x theo (u2 tafc% 3o hang bang 3o cot va cac 9han t cua x nam tDe#n ng cheo cua v! 0h\$c hien% GH/I. JKLMC 0NOPQR+ 6 B5 6 +4HS% GH/I. JK/R+ HKT c

Khao sat ng dung MATLAB trong ieu khien t ong '% tham 3o *nh a\$ng cho v, 3o hang va cot cua v 8 n > ab3C'"! Reu ' 8 = ng cheo cua v ch,nh la cac 9han t cua x Reu ' q = cac 9han t cua x nam 9h,a tDe#n ng cheo v Reu ' p = cac 9han t cua x nam 9h,a i ng cheo v " 4, u\$% x8 5 v8 5 = = = v8 = = = = = = = v8 5 = = = = v8 = = 5 = = = = = = = = = = = = = = = = = = 6 B? 6 +4HS% = 7 = = = = = Y = = = = = B = = = = = A = = = = = = = 5 = = = = = = = 7 = = = = = = = Y = = = = = = = B = = = = = = = A = = = 7 = = = = Y = = = = = = = = A 7 Y B A v 8 iagCx"

v 8 iagCx,5"

v 8 iagCx,="

v 8 iagCx,65"

## 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

Khao sat ng dung MATLAB trong ieu khien t ong = = = = 8! Lenh E?E a" Co#ng u\$ng% 0a\$o ma tDan n v*! b" Cu 9ha9% 2 8 e2eCn" 2 8 e2eCn,m" c" +iai th,ch% n% ta\$o ma tDan co n hang, n cot! m, n% ta\$o ma tDan co m hang, n cot! " 4, u\$% 2 8 e2eC?" 28 7 = = 28 7 = = = 7 = = = 7 = = = = = = = 7 = = = 7 7 = = = = Y = = = = B = = = = A = = = = = = = =

2 8 e2eC?,B"

9! Lenh @L&PL7 a" Co#ng u\$ng% Chu2en cac 9han t cua cac ma tDan theo th t\$ cot ng\$c la\$i! b" Cu 9ha9% b 8 <li9lDCa" c" +iai th,ch% b% te#n ma tDan \$c chu2en oi! a% te#n ma tDan can chu2en oi! " 4, u\$% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 BA 6 +4HS%

## Khao sat ng dung MATLAB trong ieu khien t ong a8 = B A Y 7 c ? d 5 X 5 X ? d 7 c A Y = B

b 8 <li9lDCa"

:' Lenh @L&P%/ a" Co#ng u\$ng% Chu2en cac 9han t cua ma tDan theo th t\$ hang ng\$c la\$i! b" Cu 9ha9% b 8 <li9u Ca" c" +iai th,ch% b% te#n ma tDan \$c chu2en oi! a% te#n ma tDan can chu2en oi! " 4, u\$% a8 7 5 ? A B c

b 8 <li9u Ca" b8 ? 5 7 ;' Lenh & H a" Co#ng u\$ng% 0m ma tDan ngh*ch ao! b" Cu 9ha9% .a tDan ngh*ch ao 8 inv Cma tDan" c" 4, u\$% 0m ma tDan ngh*ch ao cua a! a8 7 5 = 6 BB 6 +4HS% c B A

## 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

Khao sat ng dung MATLAB trong ieu khien t ong 5 A b8 B 5 65 7 7 65 67 = 65 a" Co#ng u\$ng% Sung e ta\$o 7 ma tDan gom co n hang va m cot! b" Cu 9ha9% 0e#n ma tDan 8 Ea77 a75wa7m k a57 a55w a5m kwkwF c" +iai th,ch% a77, a75, a7m la cac gia tD* ta\$i hang 7 cot 7 en cac gia tD* ta\$i hang 7 cot m, co n au Ck" la co n hang! " 4, u\$% 0a\$o ma tDan gom ? hang va ? cot vi gia tD* la 7 A 7 5 B = ? c = ? c = B 7= 67 67

b 8 invCa"

## <' Lenh tao 2a tran

a 8 E7 5 ?k A B ck 7 = =F a8 7 5 A 7 B =

=' Lenh tao ]e0tor Yn a" Co#ng u\$ng% &enh na2 ung e ta\$o 7 vectoD n gom co n 9han t! b" Cu 9ha9 7% 0e#n vectoD 8 E9t7 9t5 9t? w9tnF c" +iai th,ch% 9t7 9t5 w9tn% la cac 3o th\$c! " 4, u\$% 0a\$o vectoD a gom co A 9han t, vi cac gia tD* la%7, ?, X, A a 8 E7 ? X AF 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 Bc 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong a8 7 ? X A e" Cu 9ha9 5% 0e#n vectoD 8 gt%c3c%gt't <" +iai th,ch% gt% la gia tD* baft au cua vectoD! c3c% ca9 3o cong! gt't% gia tD* 'et thuc! g" 4, u\$% 0a\$o vectoD a co gia tD* baft au =!5, gia tD* 'et thuc 9ie5 C8 7!BX=d", ca9 3o cong =,?! a 8 =!5k=!?k9ie5 a8 =!5====!B====!d===7!7===7!A=== *>' Lenh L& +PA"E a" Co#ng u\$ng% 0a\$o vectoD co gia tD* nga;u nhie#n gii ha\$n tDong 'hoang *nh tDc! b" Cu 9ha9% 2 8 lin39aceCx7, x5" 2 8 lin39aceCx7, x5, n" c" +iai th,ch% 2% te#n cua vectoD! x7, x5% gii ha\$n gia tD* ln nhat va nho nhat cua vectoD 2! n% 3o 9han t cua vectoD 2! Reu 'ho#ng co gia tD* n th ma)c *nh n 8 7==! " 4, u\$% 2 8 lin39aceC7, 7=, X" 2 8 7!==== 7=!==== a" Co#ng u\$ng% .a tDan chu2en v* 8 ma tDan ang co! b" Cu 9ha9% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 BX 6 +4HS% 5!B=== A!==== B!B=== X!==== d!B===

## **' Ma tran 0hu(en ]_

Khao sat ng dung MATLAB trong ieu khien t ong 0a\$o 7 ma tDan chu2en v* t 7 ma tDan ang co! c" 4, u\$% a8 7 A X b 8 a` b8 A B c X d Y 5 B d ? c Y

ma tDan chu2en v* b

*4' Lenh MAA&" a" Co#ng u\$ng% 0a\$o 7 ma tDan vuo#ng co tong cua cac 9han t tDong 7 hang, 7 cot hoa)c tDe#n ng cheo bang nhau! b" Cu 9ha9% 0e#n ma tDan 8 magicCn" c" +iai th,ch% n% ',ch thc ma tDan! +ia tD* cua mo;i 9han t tDong ma tDan la mot a2 3o ngu2e#n lie#n tu\$c t 7 en 5n! 0ong cac hang, cot va cac ng cheo eu bang nhau! " 4, u\$% tmt 8 magicC?" tmt 8 d ? A *6' 7 B Y c X 5

## ha\n 2a tran .a tDan 'et (ua 8 ma tDan 7@ ma tDan 5!

a" Co#ng u\$ng% b" 4, u\$% 0a co 5 ma tDan a va b nh tDe#n va c la ma tDan 'et (ua 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 Bd 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong c 8 a@b c8 7A ?5 B= ?5 XX 755 B= 755 7YA *8' Lenh 5 E+ a" Co#ng u\$ng% 0a\$o ma tDan ma gia tD* cua cac 9han t la 7! b" Cu 9ha9% 2 8 one3Cn" 2 8 one3Cm,n" c" +iai th,ch% 2 8 te#n ma tDan! n% ta\$o ma tDan co n hang m, n% ta\$o ma tDan co m hang, n cot! " 4, u\$% 2 8 one3C?" 28 7 7 7 28 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7

2 8 one3C?,B"

*9' Lenh PA+"AL a" Co#ng u\$ng% 0a\$o ma tDan theo (u2 luan tam giac Ga3cal! b" Cu 9ha9% 9a3cal Cn" c" +iai th,ch% n% la 3o hang Ccot" 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 BY 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong " 4, u\$% 9a3calCA" an3 8 7 7 7 7 7 5 ? A 7 ? c 7= 7 A 7= 5=

*:' Lenh 7A / a" Co#ng u\$ng% 0a\$o ma tDan ma 'et ma gia tD* cua cac 9han t la nga;u nhie#n! b" Cu 9ha9% 2 8 Dan Cn" 2 8 Dan Cm,n" c" +iai th,ch% 2% te#n ma tDan! n% ta\$o ma tDan co n hang, n cot! m, n% ta\$o ma tDan co m hang, n cot! +ia tD* cua cac 9han t nam tDong 'hoang E= 7F " 4, u\$% 2 8 Dan C?" 28 =!Y?A= =!=Y5= =!X=75 =!dAc5 =!cB?Y =!Xc55 =!B5cY =!A7c= =!Xc55 2 8 Dan C?,B" 28 =!5c5B =!?5d5 =!YY7= =!Yd5c =!cB7B =!=AXB =!c?5c =!?cB? =!X55X =!=X5X =!X?c7 =!XBcA =!5AX= =!XB?A =!c?7c *;' Lenh 7E+!APE a" Co#ng u\$ng% :*nh a\$ng la\$i ',ch thc ma tDan! b" Cu 9ha9% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 c= 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong b 8 De3ha9eCa,m,n" c" +iai th,ch% b% ma tDan \$c *nh a\$ng la\$i! a% ma tDan can \$c *nh a\$ng! m, n% 3o hang va 3o cot cua b! .a tDan a 9hai co 3o 9han t la% m@n! " 4, u\$% a8 7 5 ? b8 7 ? B X Y 77 5 A c d 7= 75 *<' Lenh 75T=> a" Co#ng u\$ng% [oa2 ma tDan Y==! b" Cu 9ha9% b 8 DotY=Ca" c" +iai th,ch% b% ma tDan a \$c xoa2 Y== a% ma tDan can xoa2! " 4, u\$% a8 7 A X b8 ? 5 c B Y d 5 B d ? c Y A B c X d Y 7= 77 75

b 8 De3ha9eCa,5,c"

b 8 DotY=Ca"

7 A X *=' Lenh T7A"E 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

6 c7 6

+4HS%

Khao sat ng dung MATLAB trong ieu khien t ong a" Co#ng u\$ng% 0,nh tong cac 9han t cua ng cheo ma tDan! b" Cu 9ha9% 8 tDaceCa" c" +iai th,ch% % bien cha 'et (ua! a% te#n ma tDan! " 4, u\$% a8 5 A c d X Y 8 77 4>' Lenh T7&L a" Co#ng u\$ng% &a2 9ha#n na i ma tDan theo hnh! b" Cu 9ha9% W 8 tDilCx" W 8 tDilCx,'" c" +iai th,ch% W% te#n ma tDan 'et (ua! '% tham 3o! Reu ' 8 o la2 t ng cheo tD xuong! Reu ' 8 n la2 t ng cheo tD le#n n n v*! Reu ' 8 6n la2 t ng cheo tD xuong n n v*! " 4, u\$% a8 B Y 7? c 7= 7A X 77 7B d 75 7c i 8 tDilCa" 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 c5 6 +4HS% ? 7 5

8 tDaceCa"

## Khao sat ng dung MATLAB trong ieu khien t ong i8 7 5 ? A i8 7 5 ? A i8 7 5 ? A i8 = 5 ? A = = X d = = = 75 = = = = B c X d = 7= = = = c X d = = 77 = = = = c X d = = 77 75 = = 7B 7c

i 8 tDilCa,="

75 7c

i 8 tDilCa,7"

77 7B 75 7c

i 8 tDilCa,67"

4*' Lenh T7&% a" Co#ng u\$ng% &a2 9ha#n na tDe#n ma tDan theo hnh tam giac! b" Cu 9ha9% W 8 tDiuCx" W 8 tDiuCx,'" c" +iai th,ch% W% te#n ma tDan 'et (ua! '% tham 3o Reu ' 8 = la2 t ng cheo tD le#n! 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 c? 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong Reu ' 8 n la2 t ng cheo tD xuong n n v*! Reu ' 8 6n la2 t ng cheo tD le#n n n v*! " 4, u\$% a8 7 5 ? A W8 7 = = = W8 7 = = = W8 7 5 = = W8 = = = = B c X = B = = = Y 7= 77 75 Y 7= = = 7? 7A 7B 7c 7? 7A 7B = B c = = Y 7= 77 = 7? 7A 7B 7c B c = = Y 7= 77 = 7? 7A 7B 7c B c X d Y 7= 77 75 7? 7A 7B 7c

W 8 tDiuCa"

W 8 tDiuCa,="

W 8 tDiuCa,67"

W 8 tDiuCa,7"

44' Lenh CE75+ a" Co#ng u\$ng% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 cA 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong 0a\$o ma tDan ma gia tD* cua cac 9han t b" Cu 9ha9% 2 8 leDo3Cn" 2 8 leDo3Cm,n" c" +iai th,ch% 2% te#n ma tDan! n% ta\$o ma tDan co n hang va n cot! m, n% ta\$o ma tDan co m hang, n cot! " 4, u\$% 2 8 leDo3C?" 28 = = = 28 = = = = = = = = = = = = = = = = = = = = = = = = = = =

2 8 leDo3C?,X"

## &S' "AF" P!EFP T` ! KAJ& +5W

*' Lenh "5 H a" Co#ng u\$ng% Rha#n hai a thc! b" Cu 9ha9% c 8 convCa,b" c" +iai th,ch% a,b% a thc c% t,ch 3o cua a,b Cach 'hai bao% 3af9 xe9 bien theo th t\$ giam tha! " 4, u\$% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 cB 6 +4HS% an cua lu2

Khao sat ng dung MATLAB trong ieu khien t ong Rha#n hai a thc C?x5>Ax>B"!C5x?6?x5>5" a 8 E= ? A BF a8= ? A B b 8 E5 6? = 5F b 85 6? = 5 c 8 convCa,b" c8= c 67 65 6Y d 7= 4' Lenh "%MP75/ a" Co#ng u\$ng% Rha#n on cac 9han t! b" Cu 9ha9% c9 8 cum9Do Ca" c" +iai th,ch% c9% bien cha 'et (ua a% te#n cua ma tDan ha2 vectoD! " 4, u\$% b8 7 c9 8 7 a8 7 Y A c9 8 ? 7 5 7 Y B 5 7 ? ? B 7= 7= Y Y ? A c9 8cum9Do Cb" 5X 7=d

c9 8 cum9Do Ca"

## ?c c 6' Lenh "%M+%M a" Co#ng u\$ng%

Cong on cac 9han t! b" Cu 9ha9% c3 8 cum9Do Ca" c" +iai th,ch% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 cc 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong c3% bien cha 'et (ua! a% la te#n cua ma tDan ha2 vectoD! " 4, u\$% b87 7= 7 5 B c3 8 cum3umCb" c3 87 77 75 7A 7Y a8 7 Y A c3 8 7 ? B X d 7= A 7A c a" Co#ng u\$ng% Chia hai a thc! b" Cu 9ha9% E(,DF 8 econvCa,b" c" +iai th,ch% a,b% a thc! (% thng 3o cua a, b! D% 3o ! Cach 'hai bao% 3af9 xe9 bien theo th t\$ giam tha! " 4, u\$% Chia 5 a thc C5x5>?x>c"eC5x>?" a 8 E5 ? cF b 8 E5 ?F E(,DF 8 econv Ca,b" (87 = D8 = = c 6 cX 6 +4HS% 9' Lenh ESPM 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT an cua lu2 ? 7 5 B 5 7

c3 8 cum3umCa"

## 8' Lenh /E"5 H

Khao sat ng dung MATLAB trong ieu khien t ong a" Co#ng u\$ng% 0,nh ex b" Cu 9ha9% '( 8 ex9mCx" c" +iai th,ch% '(% biencha 'et (ua! " 4, u\$% '( 8 ex9mC?" '( 8 5=!=dBB :' Lenh @M& a" Co#ng u\$ng% 0m gia tD* nho nhat cua ham 3o! b" Cu 9ha9% x 8 <minC_<uction`,x7,x5" c" +iai th,ch% x% bien cha 'et (ua! <uction% te#n ham 3o! x7, x5% 'hoang 'hao 3at! " 4, u\$% 0m gia tD* nho nhat cua ham 3o% x?65x6B tDong 'hoang E= 5F x 8<minC_x!n?65@x6B`,=,5"k x 8 =!d7cB 2 8 <Cx" 2 8 6c!=ddX ;' Lenh @PL5T a" Co#ng u\$ng% 4e o th* cua ham 3o! b" Cu 9ha9% <9lotC_<un`,Exmin,xmaxF c" +iai th,ch% <un% te#n ham 3o! xmin, xmax% xac *nh 'hoang can ve! " 4, u\$% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 cd 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong <9lotC_x!n?65@x6B`,E=,5F"k gDi k <' Lenh @CE75 a" Co#ng u\$ng% 0m iem = cua ham 3o! b" Cu 9ha9% <leDoC_<un`,x=" c" +iai th,ch% :iem = cua ham 3o la iem C=,x", a#2 cung ch,nh la nghiem cua ham 3o! Reu ham 3o co nhieu nghiem th 3e tm \$c nghiem gan gia tD* x=! <un% te#n ham 3o! c" 4, u\$% 0m gia tD* = cua ham 3o% x56Bx>?! 0Dc tie#n ta 'hai bao ham 3o < tDong ta9 tin <!m% Cxem the#m lenh <unction" <unction 2 8 <Cx"k 2 8 x!n56B@x>?k gau o, ta\$o ta9 tin gt=!m% x 8 =%7=k r +ia tD* x= 8 = l 8 <leDoC_<`,="k 39Din<C_l 8 r?<`,l" l 8 =!?d5 r +ia tD* x= 8 5 l 8 <leDoC_<`,5"k 39Dint<C_l 8 r!?<`,l" l 8 5!c7d r 4e o th* ham 3o minh ho\$a% l 8 <leDoC_<`,="k <9lotC_<`,E=,BFk gDi k hol onk 9lotCl,=,_o`"k 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 cY 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong hol o<< =' Lenh MAS a" Co#ng u\$ng% 0m gia tD* ln nhat! b" Cu 9ha9% m 8 maxCx" Em,iF 8 maxCx" v 8 maxCx,2" c" +iai th,ch% x,2,v%te#n vectoD! m% gia tD* ln nhat! i% v* tD, cua m! Reu x la ma tDan tm Da gia tD* ln nhat cua mo;i cot! " 4, u\$% x8? B5 7 A m8 maxCx" m8B Em,iF 8 maxCx" m 8B i 85 28 7 cd 6B d ? 7 A v 8maxCx,2" v8? c b8 ? 7 5 c X d 5 Y 7 Y Y 5

m 8 maxCb" m8? d m8 ? d i87 a8 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 X= 6 +4HS% ? Em,iF 8 maxCb"

## Khao sat ng dung MATLAB trong ieu khien t ong = X A v8 ? X A c X d c Y d ? 7 c c 7 d

v 8 maxCa,b"

*>' Lenh MEA a" Co#ng u\$ng% 0m gia tD* tDung bnh! b" Cu 9ha9% .o# hnh 8 meanCa" c" +iai th,ch% m% bien cha 'et (ua! a% te#n vectoD ha2 ma tDan can t,nh gia tD* tDung bnh! Reu a la ma tDan th t,nh gia tD* tDung bnh cua mo;i cot! " 4, u\$% b 8 7 7= 7 m 8 meanCb" m 8 ?!d=== a8 7 Y A ? 7 5 B 5 7 5!==== 5!cccX 5 B

m 8 meanCa" m 8 A!cccX **' Lenh M& a" Co#ng u\$ng% 0,m gia tD* nho nhat b" Cu 9ha9% m 8 minCx" Em,iF 8 minCx" 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 X7 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong v 8 minCx,2" c" +iai th,ch% x,2,v% te#n vectoD! m% la gia tD* ln nhat! i% la v* tD, cua m! Re#u x la ma tDan tm Da gia tD* nho nhat tDong mo;i cot! " 4, u\$% x8? B 5 7 A m 8 minCx" m87 i 8A 2 87 c d 5 6B ? v 8 minCx,2" v87 B b8 ? 7 5 c X d 5 Y 7 7 ? 6B ?

## m 8 minCb" m87 c i85 a8 = X A v8 = 7 5 ? 7 c 5 7 7 ? 7 c c 7 d 7

v 8 minCa,b"

*4' Lenh P75/ a" Co#ng u\$ng% Rha#n cac 9han t! 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 X5 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong b" Cu 9ha9% 9 8 9Do Cx" c" +iai th,ch% 9% bien cha 'et (ua! x% te#n ma tDan ha2 a2 3o! Reu la ma tDan nha#n tng 9han t cua mo;i cot! " 4, u\$% a85 ? A B 9 8 9Do Ca" 9 8 5= b8 5 B X 5 c B ? A A

9 89DotCb" 9 8X= c= Ad *6' Lenh 755T+ a" Co#ng u\$ng% 0m nghiem cua a thc! b" Cu 9ha9% D 8 Doot3C9" c" +iai th,ch% D% bien cha 'et (ua! 9% te#n bieu thc! " 4, u\$% 0m nghiem cua 9hng tDnh% x567 8= 9 8 E7 = 67F D 8 Doot3C9"k i39CD" 67!==== 7!==== *8' Lenh +57T a" Co#ng u\$ng% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 X? 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong gaf9 xe9 mang ha2 ma tDan theo th t\$ taZng an! b" Cu 9ha9% '( 8 3oDtCx" E'(,iF 8 3oDtCx" c" +iai th,ch% '(% bien cha 'et (ua! i% 3o th t\$ cua 9han t tDc 'hi 3af9 xe9! Reu x la ma tDan th 3af9 xe9 theo th t\$ taZng an cua tng cot! " 4, u\$% a85 d B c 5 5 B 6? Y B c 5 c d c d Y Y '( 8 3oDtCa" '( 8 6? E'(,iF 8 3oDtCa" '( 8 6? i8 b8 ? 5 7 A 6? c 5 6A B B 7 ? A

E'(,iF 8 3oDtCb"

## 7 ? 5 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

Khao sat ng dung MATLAB trong ieu khien t ong *9' Lenh +%M a" Co#ng u\$ng% 0,nh tong cua cac 9han t! b" Cu 9ha9% 3 8 3umCx" c" +iai th,ch% 3% la bien cha 'et (ua! x% la te#n ma tDan! Reu x la ma tDan th 3 la tong cua cac cot! " 4, u\$% a8 5 dB c 6? Y 3 8 3umCa" 3 8 5X b8 ? 5 7 A c 6A 5 ? 6? B

3 8 3umCb" 38c X

## S' TAP LE ! K5a !5JA

*' Lenh ASE+ a" Co#ng u\$ng% :a)t cac tDu\$c to\$a o ta\$i v* tD, *nh tDc! b" Cu 9ha9% axe3C_9Do9eDt2name`, 9Do9eDt2value w" c" +iai th,ch% 0ng ng vi mot 9Do9eDt2name i 'em vi 7 9Do9eDt2value! 7! _9o3ition`,Ele<t, bottom, mi th, heightF% *nh v* tD, va ',ch thc cua tDu\$c! le<t% 'hoang cach t me9 tDai ca 3o en tDu\$c ng! bottom% 'hoang cach t me9 i ca 3o en tDu\$c ngang! mi th% chieu ai cua tDu\$c ngang! 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 XB 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong height% chieu cao tDu\$c ng! +hi chu% &uo#n la2 iem E=,=F lam goc to\$a o! 0Du\$c ngang va tDu\$c ng co gia tD* tDong 'hoang E= chia theo t2 le th,ch h\$9 @e 4, u\$% axe3C_9o3ition`,E!7 x! @e 4, u\$% axe3C_xlim`, E5BF" ?! _2lim`, Emin,maxF% *nh gia tD* nho nhat va ln nhat tDe#n tDu\$c 2! @e 4, u\$% axe3C_2lim`, E5BF" *nh gia tD* tDe#n ca hai tDu\$c axe3C_xlim`, Emin,maxF, _2lim`,Emin,maxF" 4' Lenh AS&+ a" Co#ng u\$ng% Chia la\$i tDu\$c to\$a o! b" Cu 9ha9% axi3CExmin xmax 2min 2maxF" axi3CExmin xmax 2min 2max lmin lmaxF" axi3 on axi3 o<< c" +iai th,ch% xmin, 2min, lmin% la gia tD* nho nhat cua cac tDu\$c x, 2, l! xmax, 2max, lmax% la gia tD* ln nhat cua cac tDu\$c x, 2, l! on% cho hien th* tDu\$c to\$a o! o<<% 'ho#ng cho hien th* tDu\$c to\$a o! 6' Lenh BA7 a" Co#ng u\$ng% 4e o th* a\$ng cot! b" Cu 9ha9% baDCx,2" 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 Xc 6 +4HS% !7 !d !cF" 5! _xlim`, Emin,maxF% *nh gia tD* nho nhat va ln nhat tDe#n tDu\$c 7F va

Khao sat ng dung MATLAB trong ieu khien t ong c" +iai th,ch% 4e gia tD* x theo gia tD* 2! " 4, u\$% x 8 69i%=!5%9ik baDCx,3inCx""k gDi on titleC_So thi ham 3inCx" ang thanh`" xlabelC_tDuc x CDa "`" 2labelC_2 8 3inCx"`"

8' Lenh "LA a" Co#ng u\$ng% [oa tat ca cac oi t\$ng nh% ng o th*, te#n o th*w nhng 'ho#ng xoa tDu\$c to\$a o! b" Cu 9ha9% cla 9' Lenh "L@ a" Co#ng u\$ng%

## 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

6 XX 6

+4HS%

Khao sat ng dung MATLAB trong ieu khien t ong [oa hnh anh Co th*" hien ta\$i! b" Cu 9ha9% cl< :' Lenh "L5+E a" Co#ng u\$ng% :ong hnh anh Co th*" hien ta\$i! b" Cu 9ha9% clo3e ;' Lenh "5L57MAP a" Co#ng u\$ng% 0a\$o mau 3afc cho o th* tDong 'ho#ng gian ? chieu! b" Cu 9ha9% coloDma9Cma9" coloDma9C_ e<ault`" c" +iai th,ch% ColoDma9 la 3\$ tDon la;n cua ? mau c ban% De , gDeen, blue! 0u2 theo t2 le cua ? mau c ban ma cho Da cac mau 3afc 'hac nhau! _ e<ault`% mau co \$c la mau ma)c *nh! ma9% bien cha cac tho#ng 3o 3au% .a9 1one Cool blag +Da2 Hot Gin' mau co \$c gDa2 > blue c2an > magenta De > mhite > blue > blac' gDa2 blac' > De > 2ellom > mhite 9in'

<' Lenh @&A%7E a" Co#ng u\$ng% 0a\$o mi hnh anh Co th*"! b" Cu 9ha9% <iguDe =' Lenh A"A a" Co#ng u\$ng% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 Xd 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong 0a\$o cac a)c t,nh cho tDu\$c! b" Cu 9ha9% h 8 gca c" +iai th,ch% h% la bien gan cho lenh cga! Cac a)c t,nh cua tDu\$c gom co% Cu 9ha9 getCgca,`[gcale`,`log`, `T3cale`,`lineaD`" +iai th,ch :*nh n v* tDe#n tDu\$c to\$a o% tDu\$c x co n v* la log va tDu\$c 2 co n v* tu2en t,nh! 0a\$o li cho o th*% tDu\$c x co ta\$o li va tDu\$c 2 'ho#ng ta\$o li! :oi tDu\$c to\$a o% oi tDu\$c x ve 9h,a oi ien, tDu\$c 2 gi ngu2e#n! :a)t mau cho li o th*% a)t li tDu\$c x mau o, li tDu\$c 2 mau vang! +om co cac mau% 2ellom, magenta, c2an, De , gDeen, blue, mhite, blac'! *>' Lenh A7&/ a" Co#ng u\$ng% 0a\$o li to\$a o! b" Cu 9ha9% gDi on gDi o<< c" +iai th,ch% on% hien th* li to\$a o! o<<% 'ho#ng hien th* li to\$a o! **' Lenh PL5T a" Co#ng u\$ng%

## 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

6 XY 6

+4HS%

Khao sat ng dung MATLAB trong ieu khien t ong 4e o th* tu2en t,nh tDong 'ho#ng gian 5 chieu! b" Cu 9ha9% 9lotCx,2" 9lotCx,2,`linet29e`" c" +iai th,ch% x,2% ve gia tD* x theo gia tD* 2! linet29e% 'ieu 9han t ta\$o ne#n net ve bao gom ? thanh 9han% 6 0hanh 9han th nhat la cac '2 t\$ ch\ mau 3afc% -2 t\$ 2 m c D g b m ' -2 t\$ 6 % 6! 66 .au 4ang :o ti & :o &u\$c &am 0Dafng :en &oa\$i net ve :ng lien net :ng cham cham :ng ga\$ch cham :ng net t oa\$n

## 6 0hanh 9han th hai la cac '2 t\$ ch\ net ve cua o th*%

6 0hanh 9han th ba la cac '2 t\$ ch\ loa\$i iem anh au gom%!, o, x, >, @ " 4, u\$% 4e o th* ham 2 8 3inCx" vi o th* mau lam, ng lien net va anh au cac iem \$c cho\$n bang au @, tDu\$c x tha2 oi t = ti 5, mo;i bc tha2 oi la ed x 8 =%9ied%5@9ik 2 8 3inCx"k 9lotCx,2, _b6@ `" 2labelC_2 8 3inCx"`" 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 d= 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong xlabelC_0Duc x`" titleC_So thi ham 2 8 3inCx"`" gDi on

*4' Lenh +%BPL5T a" Co#ng u\$ng% 0a\$o cac tDu\$c tDong mot 9han cua ca 3o o ho\$a! b" Cu 9ha9% 3ub9lotCm,n,9" 3ub9lotCmn9" c" +iai th,ch% 3ub9lotCm,n,9" hoa)c 3ub9lotCmn9"thanh ca 3o o ho\$a thanh mn vung e ve nhieu o th* tDe#n cung mot ca 3o! m% 3o hang \$c chia! n% 3o cot \$c chia 9% 3o th t\$ vung cho\$n e ve o th*! Reu 'hai bao 9 q mn th 3e xuat hien mot tho#ng bao lo;i! " 4, u\$%

## 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

6 d7 6

+4HS%

Khao sat ng dung MATLAB trong ieu khien t ong Chia ca 3o o ho\$a thanh 5? vung va hien th* tDu\$c cua ca c vung! 3ub9lotC5?7" 3ub9lotC5?5" 3ub9lotC5??" 3ub9lotC5?A" 3ub9lotC5?B" 3ub9lotC5?c"

*6' Lenh +EM&L5ASE +EM&L5A? a" Co#ng u\$ng% 4e o th* theo logaDith! b" Cu 9ha9% 3em2logxCx,2" 3em2logxCx,2,`linet29e`" 3em2log2Cx,2" 3em2log2Cx,2,`linet29e`" c" +iai th,ch%

## 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

6 d5 6

+4HS%

Khao sat ng dung MATLAB trong ieu khien t ong 3em2logx va 3em2log2 giong nh lenh 9lot nhng ch\ 'hac mot ieu la lenh na2 ve o th* theo tDu\$c logaDith! So o, ta co the 3 u\$ng tat ca cac loa\$i _linet29e` cua lenh 9lot! " 4, u\$% 4e o th* ham 2 8 x5 o ?x > 5 theo tDu\$c logaDith cua x! x 8 =%7==k 2 8 x!n56?@x>5k 3em2logxCx,2,`b`" gDi on

*8' Lenh P5LA7 a" Co#ng u\$ng% 4e o th* tDong he tDu\$c to\$a o c\$c! b" Cu 9ha9% 9olaDCtheta,Dno" c" +iai th,ch% 4e gia tD* x theo gia tD* 2! " 4, u\$% t 8 69i%=!=7%9ik 9olaDCt, 3inCt"" 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 d? 6 +4HS%

## Khao sat ng dung MATLAB trong ieu khien t ong

*9' Lenh +ET a" Co#ng u\$ng% 0hiet la9 cac a)c t,nh chat cho oi t\$ng nao o! b" Cu 9ha9% 3etCh, _9Do9eDt2name`, 9Do9eDt2value,w" c" +iai th,ch% h% bien cha oi t\$ng! GDo9eDt2Rame va GDo9eDt24alue \$c cho tDong bang 3au% Cu 9ha9 getCh,`.aD'eD`,`>`" getCh,`&ineVi th`,7" getCh,`.aD'eDgile`,Y" getCh,`coloD`,`c2an`" GDo9eDt2Ram e .aD'eD &ineVi th .aD'eDgile ColoD GDo9eDt24alue 6, 66, %, 6! , o, , >, @ 7, 5, ?,w 7, 5, ?,w +iai th,ch Cho\$n 'ieu 9han t :o a2 net ve -,ch thc cac iem ta\$o ne#n h

## 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT

Khao sat ng dung MATLAB trong ieu khien t ong ' " 4, u\$% a 8 E7 5 ? A B A ? A B cFk h 8 9lotCa" 3etCh,`coloD`,`blac'`"

*:' Lenh +TA&7+ a" Co#ng u\$ng% 4e o th* a\$ng bac thang! b" Cu 9ha9% 3taiD3Cx,2" c" +iai th,ch% 4e gia tD* x theo gia tD* 2! " 4, u\$% x 8 69i%=!5%9ik 3taiD3Cx,3inCx"" xlabe&C_0Duc x`" 2labelC_2 8 3taiD3Cx,3inCx"`" 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 dB 6 +4HS%

## Khao sat ng dung MATLAB trong ieu khien t ong gDi on

*;' Lenh T&TLE a" Co#ng u\$ng% :a)t tie#u e cho o th*! b" Cu 9ha9% titleC_text`" c" +iai th,ch% text% te#n tie#u e! *<' Lenh SLABELE ?LABELE CLABEL a" Co#ng u\$ng% :a)t te#n cho tDu\$c [, T, |! b" Cu 9ha9% xlabelC_nx`" 2labelC_n2`" llabelC_nl`" c" +iai th,ch% nx, n2, nl% te#n tDu\$c x, 2, l *=' Lenh D!&TEBA a" Co#ng u\$ng% 0h\$c hien% GH/I. JKLMC 0NOPQR+ GH/I. JK/R+ HKT 6 dc 6 +4HS%

Khao sat ng dung MATLAB trong ieu khien t ong 0ha2 oi mau nen cua ca 3o o ho\$a! b" Cu 9ha9% mhitebg mhitebgC_coloD`" c" +iai th,ch% mhitebg chu2en oi (ua la\$i mau nen ca 3o o ho\$a gia tDafng va en! mhitebgC_coloD`" chu2en mau nen ca 3o o ho\$a thanh mau cua bien coloD! coloD co the la cac mau% 2ellom Cvang", magenta Co ti", c2an Cl", De Co", gDeen Clu\$c", blue Clam", mhite CtDafng", blac' Cen"! BT60) \$c viet tDong BT60'2! 1ai ta9 na2 tong h\$9 t cac 3ach QThe +tudent Edition ob MATLABRE QThe MATLAB 9' !andPoo1RE QGFng dung MATLAB trong ieu khien t ongR
%BT"c: V5 678 9:8 ;87 <.%,==meshgri((4":0\$ :")* >=pea+s(.%,)* meshc(.%,%>) pause +=#* n=&?+4 * <.%,%>==sphere(n)* c=ha(amar((&?+)* sur-(.%,%>%c)* colormap(< 0*0 pause

=)

t=0:pi@ 0:&Api* <.%,%>==c,lin(er(&!cos(t))* sur-(.%,%>) pause <.%,%>==c,lin(er( : 0)* sur-norm(.%,%>) pause <.%,%>==meshgri((4&:\$&:&%4&:\$&:&%4&:\$&:&)* v=.\$Ae.p(4.\$?&4,\$?&4>\$?&)* slice(v%<# # & =%& %< 0=%& ) pause <B%C==meshgri((4":\$#:")* D=pea+s(B%C)* <B:%C:==meshgri((4":\$&#:")* D:=interp&(B%C%D%B:%C:)* mesh(B%C%D)% hol(% mesh(B:%C:%D:! #) hol( o-a.is(<4" " 4" " 4# &0=)

6 dX 6

+4HS%

## Khao sat ng dung MATLAB trong ieu khien t ong

pause s,ms . , e>sur-(real(atan(.!iA,))) <.%,==mesh(om(4 &:\$': &%4 &:\$': &)* r=s1rt(.\$?&!,\$?&)* >=bessel(0%r)* m=<44# '0=* mesh(>%m)

6 dd 6

+4HS%

6 dY 6

+4HS%

6 Y= 6

+4HS%

6 Y7 6

+4HS%

6 Y5 6

+4HS%

6 Y? 6

+4HS%

## Cung la ham Pesse3 nhng ta 'hao 3at Die#ng 7 bai%

%hm bessel <.%,==mesh(om(4 &:\$': &%4 &:\$': &)* r=s1rt(.\$?&!,\$?&)* >=bessel(0%r)* m=<44# '0=* mesh(>%m)

6 YA 6

+4HS%

6 YB 6

+4HS%