Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.
Próxima SlideShare
Cargando en…5
×

# Introduction to Matlab

introduction to Matlab programming language for engineering,vector ,matrix,statistics,mathematics,control loops,plotting,gui,simulink

Ver todo

#### Gratis con una prueba de 30 días de Scribd

Ver todo
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Inicia sesión para ver los comentarios

### Introduction to Matlab

1. 1. Introduction To Matlab Prepared by : 1 Prepared by: Eng. Amr Ezz Eldin Rashed Assistant lecturer TAIF university,KSA TEL:ksa 0554404723
2. 2. Outlines(First Level) _24 hour What is Matlab Basic commands Vectors and matrices Statistics for vector and matrix Control loops(if,for,switch,break) 2D plotting , mathematics(int ,diff ,limit,..) Exam 2
3. 3. Outlines(Second Level)_24hour 3D plotting, animation Dialog box Simulink Graphical user interface Image and sound processing البرامج الجاهزة Project EXAM 3
4. 4. Outlines(Third Level)_24 hour Introduction to Image Processing Point Processing ,Spatial Filtering Neighborhood Processing The Fourier Transform Image Restoration Image Segmentation project 4
5. 5. What is Matlab? What is possible in Matlab? graphic examples How Matlab works? matrix, vector & scalar syntax & important operators basic commands & plot commands creating a m-file Statistics in Matlab some basics & example Algebraic operations in Matlab Useful links & other tutorials 5 Introduction to MATLAB
6. 6. What is MATLAB The name MATLAB stands for Matrix laboratory(or mathematical laboratory). MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. It‟s both a computer programming language, and a software environment for using that language effectively. Typical 6
7. 7. What is MATLAB Matlab is a commercial "Matrix Laboratory" package which operates as an interactive programming environment. Matlab is available for PC's, Macintosh and UNIX systems. Matlab is well adapted to numerical experiments. Matlab program and script files (m-files) always have filenames ending with ".m"; The programming language is exceptionally straightforward since almost every data object is assumed to be an array. Graphical output (figure) is available to supplement numerical results. Online help is available from the Matlab prompt (a double arrow) by typing help 7
8. 8. Typical Uses Math and computation Algorithm development Modeling, simulation, and prototyping Data analysis, exploration, and visualization Scientific and engineering graphics Application development including GUI 8
9. 9. Why use Matlab? Advantages: Handles vector and matrices very nice Quick plotting and analysis EXTENSIVE documentation (type „help‟) Lots of nice functions: FFT, fuzzy logic, neural nets, numerical integration, OpenGL (!?) Drawbacks: Slow compared to C or Java 9
10. 10. Matlab History In the 1970‟s, Cleve Moler “Professor of Math & Computer Science, Chief Author of MatLab and one of the Founders of Mathworks.Inc” participated in developing (EISPACK) and (LINPACK). Those were collection of Fortran subroutines for solving linear equations and Eigen value problems. Later, when teaching courses in mathematics, Moler wanted his students to be able to use LINPACK and EISPACK without requiring knowledge of Fortran, so he developed the first MATLAB in 1977 as an interactive system to access LINPACK and EISPACK. 10
11. 11. MatLab History The first Matlab was written in 2000 lines of Fortran, with Matrices as the only data type, 80 functions, no .m files and no toolboxes. Jack Little, one of Moler‟s students saw Matlab potentials in Control systems & Signal Processing. They founded together Mathworks, Inc. in 1980 Mathworks is now responsible for development, sale, and support for MATLAB MATLAB was rewritten in C with more functionality (such as plotting routines), and now it contains more than 80,000 functions. 11
12. 12. The Basic Matlab System It consists of 5 main parts: –Development Environment. –MATLAB Mathematical Function Library. –MATLAB Language. –Graphics. –MATLAB External Interfaces And finally the MatLab Toolboxes –Toolboxes are comprehensive collections of MATLAB functions (M- files) that extend the MATLAB environment to solve particular classes of problems. –Areas in which toolboxes are available include signal processing, control systems, neural networks, communications, wavelets, Data Acquisition, simulation, and many others. 12
13. 13. MATLAB Development Environment & Basic Math Functions 13
14. 14. Development Environment •Run the matlab 14
15. 15. Development Environment 15 Command Window History Work Space Variables stores here All of ur previous commands stores here All commands, programs runs from here
16. 16. Variables MATLAB variable names must begin with a letter, which may be followed by any combination of letters, digits, and underscores. MATLAB distinguishes between uppercase and lowercase characters, so A and a are not the same variable(case sensitive). When naming a variable, make sure you are not using a name that is already used as a function name,begin with character .
17. 17. Special Values Function description Ans Most recent answer (variable). If you do not assign an output variable to an expression, MATLAB automatically stores the result in ans. pi 3.1415926535897... inf Infinity. Calculations like n/0, where n is any nonzero real value, result in inf. I,J The imaginary unit √-1 NaN,nan Not-a-Number, an invalid numeric value. Expressions like 0/0 and inf/inf result in a NaN, as do arithmetic operations involving a NaN. n/0, where n is complex, also returns NaN.
18. 18. Special Values Description Function Beep sound beep Maximum real number that can be used realmax minimum real number that can be used realmin Specifies the accuracy of floating point Precision . الخطوة ب نٌ عدد نٌ أو أصغر عدد مٌكن تعر فٌه eps 18
19. 19. Operators Arithmetic –numeric computations, e.g., 2^10 Relational –quantitative comparison of operands –e.g., a < b Logical –AND, OR, NOT –return Boolean variable, 1 (TRUE) or 0 (FALSE)
20. 20. Arithmetic operators example symbol Operation 3+22 + Addition 54.6-16.5 _ subtraction 3.14*6 * Multiplication 10/100 10010 / or Division 2^8 ^ power 20
21. 21. Relational Operators Description Relational Operator Less than < Less than or equal <= Greater than > Greater than or equal >= Equal to == Not equal to ~= 21
22. 22. Examples Command Result 5>8 ans=0 A=5<10 A=1 Y=(6<10)+(7>8)+(5*3==60/4) Y=2 B=[15 6 9]; C=[8 20 9]; D=C>=B D=[0 1 1] B= =C ans=[0 0 1] B>6 ans=[1 0 1]
23. 23. Logical Operators Logical Operator Description & Element by element AND | Element by element OR ~ NOT && Scalar AND with short circuiting || Scalar OR with short circuiting
24. 24. Examples Command Output 3 & 7 ans=1 A=5 | 0 A=1 ~25 ans=0 (12 & 0) +(~0)+(0 | 5) ans=2 X=[9 3 0]; Y=[2 0 13] X & Y ans=1 0 0 Z=X | Y Z=1 1 1
25. 25. Operator Precedence Precedence Operation 1 (highest) ( ) 2 ^ 3 ~ 4 *, / 5 +, - 6 Relational operations >,<, … 7 & 8 |
26. 26. Complex functions Description Item Define a complex number Complex(2,-3) Absolute value ;|x| Abs(x) Angle of complex number x Angle(x) Complex conjugate of x Conj(x) Imaginary part of a complex number x Imag(x) Real part of complex number x Real(x) 26
27. 27. Example 27
28. 28. Relational and Logical Functions Function Description xor(x,y) Exclusive OR any(x) True if any element is non zero all(x) True if all elements are non zero Isequal(x,y) True if arrays are numerically equal Isfloatpt True for a floating point number isprime True for a prime number
29. 29. Example 29
30. 30. Information About System 30
31. 31. Information About System 31
32. 32. Calendar 32
33. 33. Information About System 33
34. 34. System and file commands Description Item Clears command window clc Remove variables from memory Clear , clear all Display documentation doc Checks for existence of file or variable exist Declares variables to be global global Display help text in the command window Help Display help text in the help browser helpwin Searches help entries for a keyword lookfor Stops Matlab Quit or exit List current variables who Long display) ) List current variables whos 34
35. 35. How to open file (mspaint.exe) 35
36. 36. Trigonometric functions(Radian) Description Item Inverse cosine Acos(x) Inverse cotangent Acot(x) Inverse cosecant Acsc(x) Inverse secant Asec(x) Inverse sine Asin(x) Inverse tangent Atan(x) Cosine Cos(x) cotangent Cot(x) cosecant Csc(x) Sine Sin(x) tangent Tan(x) 36
37. 37. Trigonometric functions(degree) Description Item Inverse cosine Acosd(x) Inverse cotangent Acotd(x) Inverse cosecant Acscd(x) Inverse secant Asecd(x) Inverse sine Asind(x) Inverse tangent Atand(x) Cosine Cosd(x) cotangent Cotd(x) cosecant Cscd(x) Sine Sind(x) tangent Tand(x) 37
38. 38. Hyperbolic function Description Item Inverse cosine Acosh(x) Inverse cotangent Acoth(x) Inverse cosecant Acsch(x) Inverse secant Asech(x) Inverse sine Asinh(x) Inverse tangent Atanh(x) Cosine Cosh(x) cotangent Coth(x) cosecant Csch(x) Sine Sinh(x) tangent Tanh(x) 38
39. 39. Mathematical functions item Description factor التحل لٌ ال العوامل الاول ةٌ Primes وٌلد قائمة بالاعداد الاول ةٌ الاقل من x isprime عٌ دٌ true اذا كان العدد اول اٌ Gcd القاسم المشترك الاكبر lcm ا جٌاد المضاعف المشترك الاصغر Factorial(x) لا جٌاد المضروب Gamma(x) تابع جاما Beta(x,y) تابع ب تٌا 39
40. 40. Examples 40
41. 41. Example 41
42. 42. System and file Commands item Description cd Change current directory Date Display current date dir Lists all files in the current directory mkdir Used to make new directory pwd Present work directory what Lists all matlab files Clock Display current clock and date 42
43. 43. Example 43
44. 44. Exponential functions item Description exp ًسلاا عباتلا log اللوغار تٌم الطب عٌ log10 اللوغار تٌم للاساس 10 log2 اللوغار تٌم للاساس 2 Sqrt(x) الجذر الترب عٌ nthroot الجذر من المرتبة n pow2 2^(x) expm1 Exp(x)-1 log1p Log(x+1) 44
45. 45. Example 45
46. 46. Example 46
47. 47. Erf,erfc,expint,format 47 تابع ا جٌاد الخطأ المتمم تابع ا جٌاد الخطأ ا جٌاد التكامل الاسً 15 رقم بفاصلة عائمة
48. 48. format 48 5 ةتباث ةلصافب ماقرا 5 ارقام بفاصلة عائمة 15 رقم بفاصلة عائمة الشكل الكسري
49. 49. الرياضيات في الماتلاب لا جٌاد جذور المعادلة X^4+2*x^3+4*x+5=0 >>roots([1 2 0 4 5]) ولا جٌاد المعادلة بمعرفة الحلول >>poly([1 2 3 4]) 49
50. 50. Cont. 50
51. 51. Integration 51
52. 52. Differentiation 52
53. 53. Laplace Transform 53
54. 54. Expand ,conv ,and deconv 54
55. 55. limit 55
56. 56. Vector defenition 56
57. 57. Vector definition 57
60. 60. Adding element to vector 60
61. 61. Vector statistics 61
62. 62. Max ,min ,
63. 63. Cont. 63
64. 64. Linspace , logspace 64
65. 65. Array Construction 65
66. 66. Array Construction 66
67. 67. Array orientation >> c=[1;2;3;4;5] c = 1 2 3 4 5 >> c‟ % transpose of c ans = 1 2 3 4 5
68. 68. Array orientation >> s=[1+2i 3-5i 3+4i] s = 1.0000 + 2.0000i 3.0000 - 5.0000i 3.0000 + 4.0000i >> f=s‘ f = 1.0000 - 2.0000i 3.0000 + 5.0000i 3.0000 - 4.0000i >> g=s.‘ dot transpose operator g = 1.0000 + 2.0000i 3.0000 - 5.0000i 3.0000 + 4.0000i
69. 69. Matrix definition 69
70. 70. Math. 70
71. 71. Cont. 71
72. 72. Mean and Variance
73. 73. Determine,diagonal,inverse 73
74. 74. Maximum,minimum 74
75. 75. Find location of an element 75
76. 76. برنامج لحساب زاو ةٌ خط X=[1 0 0;0 1 0;0 0 1]; [I,j]=find(x==1); Length=max(i)-min(i); Width=max(j)-min(j); Ang=atand(length/width); 76
77. 77. Determines matrix elements d=[ 1 2;4 5; 3 2] d = 1 2 4 5 3 2 >> d(1,:) %row 1 and all columns ans = 1 2 >> d(1,2) % row 1 and all column 2 ans = 2 >> d(:,2) %all row and l column 2 ans = 2 5 2
78. 78. Determines matrix elements d = 1 2 4 5 3 2 >> d(2:3,:) ans = 4 5 3 2
79. 79. Add element to matrix 79
80. 80. Add element to matrix 80
81. 81. Special Matrix(zeros,ones,magic,eye) >> f=zeros(3) zeros=false f = 0 0 0 0 0 0 0 0 0 >> g=ones(4) ones=true g = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
82. 82. Special Matrix >> v=zeros(2,3) v = 0 0 0 0 0 0 >> h=3*ones(2,4) h = 3 3 3 3 3 3 3 3
83. 83. Special Matrix >> eye(3,3) ans = 1 0 0 0 1 0 0 0 1
84. 84. True ,false 84
85. 85. Special matrix(rand,randn,randint) 85 Zero mean unit variance Random number between 0 and 1
86. 86. Mean2,std2,randint 86
87. 87. Unique,intersect,setdiff 87 لحذف ما هو مكرر وترت بٌ النت جٌة الحصول عل العناصر المشتركة ب نٌ مصفوفت نٌ الحصول عل العناصر الموجودة ف 1 وغ رٌ موجودة ف 2
88. 88. Rot90,flipud,fliplr
89. 89. Matrix operations 89
90. 90. Example 90
91. 91. Example 91
92. 92. Example 92
93. 93. Example 93
94. 94. Example 94
95. 95. Example 95
96. 96. Add element to matrix 96
97. 97. Add element to matrix 97
98. 98. Add element to matrix 98
99. 99. Reshape,repmat 99
100. 100. Approximation functions Floor : rounds value towards negative infinity Ceil: rounds value towards positive infinity Fix: rounds value towards zero Round: normal approximation 100
101. 101. Approximation functions 101
102. 102. Approximation functions 102
103. 103. Approximation functions 103
104. 104. Number systems 104
105. 105. Cont. 105
106. 106. Character matrix 106
107. 107. Character matrix 107
108. 108. Character matrix 108
109. 109. Tic,toc 109
110. 110. Multidimensional matrix 110
111. 111. Cont. 111
112. 112. Cont. 112
113. 113. Cont. 113
114. 114. Introduction to signal and image processing 114
116. 116. Image show 116
117. 117. Operations on image 117
118. 118. Operations on image >> diag(y); >> trace(y) ans = 27029 >> imshow(flipud(y)) >>imresize(y,[128 128]); 118
119. 119. Figure(2) 119
120. 120. 120 >>imshow(fliplr(y));
121. 121. Edge detection 121
122. 122. Cont. 122
123. 123. Cont. 123
124. 124. Color image,imwrite 124
125. 125. imwrite imwrite(z,'amr.jpg') imwrite(y,„d:amr2.jpg') 125
126. 126. Reading and writing sound >>[y,fs]=wavread('C:WINDOWSMediachimes.wav'); >>Help auread >> soundsc(y) or wavplay(y,fs) >>size(y) >>wavwrite(y,‟c:aa.wav‟) or auwrite >>نأخذ جزء من الصوت ونتعامل معه 126
127. 127. Operation on sound 127
129. 129. Cont. 129
130. 130. Flow Control MATLAB has several flow control constructs: For loop. If statement. Switch and case. While. Continue. Break. Try – catch. Return.
131. 131. For Loop for x = array (commands) end The (commands) are executed once for every column in array At each iteration, x is assigned to the next column of the array
132. 132. Example For i=1:10 i end نٌفذ طالما i≤10 132
133. 133. Example for i=1:10 disp(i) end لا عٌرض كلمة I بجانب كل ق مٌة 133
134. 134. Example♣♣ disp(„the numbers from 1 to 10 are:‟) for i=1:10 disp(i) end 134
135. 135. Factorial n=5; f=1; for i=2: n f=f*i; end disp(f) 135
136. 136. لإ جٌاد مجموع الأعداد من ◄ 1:5 n=5 s=0 for i=1: n s=s+i; end disp(s) 136
137. 137. لإ جٌاد مجموع مربعات الأعداد من ◄ 1:5 n=5 s=0 for i=1: n s=s+i^2; end disp(s) 137
138. 138. لإ جٌاد جذور الأعداد من ◄ 1:5 n=5; for i=1: n disp(sqrt(i)) end 138
139. 139. Example n=5 disp(„number square root‟) disp(„ „) for i=1: n AA=sqrt(I); disp([ I AA ]) لعرض مجموعة من المتغ رٌات End 139
140. 140. Example N=10 12/1! + 22/2!+………..+n2/n! الإشارة ثابتة 12/1! -22/2!+…-……..+n2/n! الإشارة متغ رٌة 140
141. 141. Example n=5; fact=1; Sum=0; For I=1:n fact=fact*I; T=(I^2)/fact; sum=sum+ T; End Disp(sum) 141
142. 142. Example ملحوظة ◄ لعمل إشارة أحد الحدود موجب والآخر سالب (-1) i+1 Fact=-1 Fact= - fact *i 142
143. 143. Example n=input („enter any integer‟); Sum =0; For i=1: n Sum=sum+i End Disp(sum); 143
144. 144. Example What is your name? How old are you? طٌبع age, name 144
145. 145. Example Nam=input („what is your name?‟ , ‟s‟); character حٌتوي على string Age=input („how old are you?‟); Disp(nam) Disp(age) 145
146. 146. Note ملحوظة: لك تٌرك سطر نستخدم علامة ولك طٌبع backslash نستخدم علامة ولطبع name ,age بجانب بعضهم Disp ([x, y]); إما أن كٌون ⤾ x, y أي جٌب أن كٌونا من نفس النوع String or num Disp ([nam, num2str (age)]); 146
147. 147. Example اطبع مجموع الأعداد التى تقبل القسمة على 5 sum=0; For i=0:5:100 sum=sum+I; end Disp(sum) 147
148. 148. Nested Loops for n=1:5 for m=5:-1:1 A(n,m)=n^2+m^2; end end A = 2 5 10 17 26 5 8 13 20 29 10 13 18 25 34 17 20 25 32 41 26 29 34 41 50
149. 149. 3x3 Mean filter 149
150. 150. While Loops while expression (commands) end Commands are executed as long as all elements in expression are true. Usually evaluation of expression gives scalar –In case of array all elements must be true
151. 151. Example while x<=15 x=2*x; end Be careful and try to avoid infinite loops! To stop the execution of an infinite loop use Ctrl+C x =3 x =24
152. 152. If-End Structure if expression (commands) end The (commands) are evaluated if all elements in expression are true (nonzero)
153. 153. If-Else-End Structure if (expression) (commands evaluated if true) else (commands evaluated if false) end
154. 154. Flow control - selection The if-elseif-else construction if <logical expression> <commands> elseif <logical expression> <commands> else <commands> end if height>170 disp(’tall’) elseif height<150 disp(’small’) else disp(’average’) end
155. 155. Example X=input ('enter any value'); If (x>0) disp ('positive'); End IF (x<0) disp ('negative'); End لا غٌلق برنامج ال matlab ب end 155
156. 156. Example iF (x>0) disp ('positive'); else if (x<0) disp ('negative'); else disp ('zero'); End ملحوظة : وٌجد دالة جاهزة تقوم بنفس الوظ فٌة sign 156
157. 157. Example أدخل ق مٌة x,y ونحدد هل x اكبر من y ام لا ونطبع x,y X is greater than y X is lower than y X is equal to y 157
158. 158. Example 158
159. 159. Example لطباعة الأعداد التى لا تقبل القسمة على 5 For i=0:100 If (rem(I,5)~=0) disp(i); End End 159
160. 160. برنامج لا جٌاد جذور معادلة ترب عٌ ةٌ Disp.→this program is used to solve the quadratic eqn Disp→ Ax2+Bx+c=0 a=input→enter the value of A:___ b=input→enter the value of B:___ c=input→ enter the value of C:___ D=B2- 4AC •X1=x2=-b/2a X1= (-B+sqrt (d))/ (2*a)) X2= (-B-sqrt (d) )/ (2*a)) 160 0 Non zero
161. 161. Program 161
162. 162. Example X=floor (rand*6) +1; If (x==1) disp ('that is 1'); Else if (x==2) disp ('that is 2'); Else if (x==3) disp ('that is 3'); Else if (x==4) disp ('that is 4'); Else if (x==5) disp ('that is 5'); Else disp ('that is 6'); Or else if (x==6) disp ('that is 6'); end 162
163. 163. برنامج درجات الطلاب 163
164. 164. Example apples=10; cost=apples*25; if apples > 5 cost=(1 -20/100)*cost % 20% discount end
165. 165. Switch-Case Construction switch expression case test_expression1 (commands1) case {test_expression2, test_expression3} (commands2) otherwise (commands 3) end
166. 166. Example method = 'Bilinear'; switch (method) case 'linear' disp('Method is linear') case 'cubic' disp('Method is cubic') otherwise disp('Unknown method.') end Method is Unknown method
167. 167. باستخدام switch فى حالة multiple cases X=floor (rand*6)+1; Switch x → expression or variable مٌكن أن كٌون Case 1 Disp ('that is 1'); Case 2 Disp ('that is 2'); Case 3 Disp ('that is 3'); Case 4 Disp ('that is 4'); Case 5 Disp ('that is 5'); Case 6 Disp ('that is 6'); Or Otherwise Disp ('that is 6'); End 167
168. 168. Program 168
169. 169. Example لحساب أكثر من حالة مع بعض X=floor (rand*6)+1; 1-if (x==1 | x==2 | x==3) 2-if (1<=x<=3) 3-case {1,2,3} disp ('from 1 to 3') case {4,5} disp ('4 or 5') case 6 / otherwise disp (that is 6'); end 169
170. 170. Program 170
171. 171. Program 171
172. 172. برنامج لعمل password 172
173. 173. Another solution 173
174. 174. Another solution 174
175. 175. program المطلوب ف البرنامج السابق جعل عدد المحاولات 3 ف حالة كلمة السر الخطأ وواحدة ف حالة الكلمة الصح حٌة. 175
176. 176. program 176
177. 177. while 177
179. 179. لحساب الوقت المستغرق لتنف ذٌ برنامج 179
180. 180. program Enter the no. of student=n Vector (x) Average = mean (x) The first = max (x) الطالب الأول The last = min (x) الطالب الأخ رٌ 180
181. 181. program 181
182. 182. Example A=[2 3;0 4]; B=[-5 7;10 2]; Display 1-add a to b 2-max value of a 3-Diag of b 4-exit 182
183. 183. program 183
184. 184. program 184
185. 185. Another solution 185
186. 186. لادخال عناصر مصفوفة Enter the number of raws Enter the number of column Enter the values 186
187. 187. program 187
188. 188. Security program 0 5 0 1 2 3 4 6 0 10 15 20 1 8 0 2 3 5 0 1 2 3 4 6 188
189. 189. program 189
193. 193. Example 193
195. 195. Cont. 195
196. 196. 196
197. 197. 197
198. 198. Example 2 198
199. 199. Cont. 199
200. 200. Cont. 200
201. 201. Cont. 201
202. 202. Cont. 202
203. 203. Cont. 203
204. 204. Cont. 204
205. 205. Cont. 205
206. 206. Simulink Power Window Controller Hybrid System Model 206
207. 207. Filtered QPSK vs. MSK 207
208. 208. Cont. 208
209. 209. AM DSB_SC modulation 209
210. 210. Scope 210
211. 211. Image processing example 211
212. 212. o/p video viewer 212
213. 213. Simple power model 213
214. 214. Cont. 214
215. 215. Scop 215
216. 216. Simple models(simpower system) 216
217. 217. Power electronic models(simpower sys) 217
218. 218. Graphical User Interface 218
219. 219. Start Guide 219
220. 220. Example 220
221. 221. Property Inspector 221
222. 222. Figure 222
223. 223. Call backs 223
224. 224. Call Backs 224
225. 225. Project 2 225
226. 226. Example 2 226
227. 227. Example 227
228. 228. Open file 228
229. 229. Pop up menu 229
230. 230. Edit button 230
231. 231. Push button 231
232. 232. Program 3 232
233. 233. Am modulation 233
234. 234. Operation 234
235. 235. Pop up menu 235
236. 236. Carr_freq 236
237. 237. Sampling_freq 237
238. 238. Am_mod 238
239. 239. Import data 239
240. 240. Code % --- Executes on button press in put. function put_Callback(hObject, eventdata, handles) % hObject handle to put (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) distor=200; set(handles.edit1,'String',distor); 240
241. 241. Calculator program 241
242. 242. Calculator program2 242
243. 243. 243
244. 244. 244
245. 245. حل المعادلة الترب عٌ ةٌ 245
247. 247. برنامج عرض صورة الوان وابضٌ واسود 247
248. 248. برنامج كلمة المرور 248
249. 249. Visible property 249
250. 250. Code 250
251. 251. Open , save (menu items) 251
252. 252. البرامج الجاهزة 252
253. 253. Funtool 253
254. 254. تحد دٌ مركز الهزة الارض ةٌ 254
255. 255. رسم اشارة وتصم مٌ المرشح المرغوب به 255
256. 256. Analog modulation 256
257. 257. RLC demo 257
258. 258. Neural network tool 258
259. 259. nftool 259
260. 260. nprtool 260
261. 261. Wavelet transform 261
262. 262. sigdemo1 262
263. 263. Filter design tool 263
264. 264. xpsound 264
265. 265. querybuilder 265
266. 266. Gui to exe) ) deploytool 266
267. 267. phone 267
268. 268. nndtoc 268
269. 269. nctool 269
270. 270. Dialog box 270
271. 271. helpdlg 271
272. 272. Input dialoge 272
273. 273. Message box 273
274. 274. Color question 274
275. 275. Warning dialog 275
276. 276. Wait bar 276
277. 277. List dialog d = dir; str = {d.name}; [s,v] = listdlg('PromptString','Select a file:',... 'SelectionMode','single',...'ListString',str) 277
278. 278. List dialog smpl_length={'20','25','30','100','200','500'}; entry2=listdlg('name','input for sample lengths','promptstring',... 'enter sample length values','liststring',smpl_length); 278
279. 279. Cont. 279
280. 280. Uigetfile 280
281. 281. uisave 281
282. 282. uiopen('figure') 282
283. 283. [file,path] = uiputfile('animinit.m','Save file name'); 283
284. 284. Graphics 284
285. 285. Sine wave 285 01234567-1-0.8-0.6-0.4-0.200.20.40.60.81
286. 286. Program 2 286
287. 287. Figure 287 00.511.522.533.540123456
288. 288. Program 3 288
289. 289. figure 289 00.511.522.533.540123456aaaaaaatime distance
290. 290. Program 4 290
291. 291. figure 291 00.511.522.533.540123456aaaaaaatime distance xxxxmove with mouse
292. 292. Program 5 292
293. 293. figure 293 123456789100100200300400500600700800
294. 294. Program 6 294
295. 295. Figure 295 01234567-50510152025303540
296. 296. Program 6 296
297. 297. الرسم بإستخدام الاحداث اٌت الدائر ةٌ 297
298. 298. figure 298 0.1 0.2 0.3 0.4 0.53021060240902701203001503301800
299. 299. Program 7 299
300. 300. Program 8 300
301. 301. Figuer 301 123456789100102030405060708090100
302. 302. Program 9 302
303. 303. figure 303 123456789100501001234567891000.51
304. 304. Program 10 304
305. 305. Program 11 305
306. 306. Program 12 306
307. 307. Figure 307 02468-1-0.500.5102468-1-0.500.5102468-1-0.500.51-50510-1-0.500.51
308. 308. Program 308
309. 309. Figure 309 02468-1-0.500.51number one02468-1-0.500.51number two02468-1-0.500.51number three-50510-1-0.500.51number four
310. 310. ezplot 310 -6-4-20246-1-0.500.51xsin(x)
311. 311. cont 311 -6 -4 -2 0 2 4 6 0 0.2 0.4 0.6 0.8 1 x sin(x)2
312. 312. 312 -505020406080100120140160x4 x2-505-50-40-30-20-1001020304050x8 x-50577.27.47.67.888.28.48.68.89x8-505-1-0.8-0.6-0.4-0.200.20.40.60.81x0
313. 313. Graphics 3d 313
314. 314. Figure 314 00.20.40.60.8100.20.40.60.8100.20.40.60.81x axisy axis z label
315. 315. program [X,Y] = meshgrid(-2:.2:2, -2:.2:2); Z = X .* exp(-X.^2 - Y.^2); surf(X,Y,Z) 315
316. 316. figure 316 -2-1012-2-1012-0.500.5
317. 317. program [X,Y] = meshgrid(-2:.2:2, -2:.2:2); Z = X .* exp(-X.^2 - Y.^2); subplot(221) mesh(Z) subplot(222) mesh(Z) view(-37.5,70) subplot(223) mesh(Z) view(-37.5,10) subplot(224) mesh(Z) view(0,0) 317
318. 318. figure 318 0204002040-0.500.5020400102030-0.500.50204002040-0.500.50102030-0.500.5
319. 319. sphere 319 -1-0.500.51-1-0.500.51-1-0.500.51
320. 320. Sphere(40) 320 -1-0.500.51-1-0.500.51-1-0.500.51
321. 321. mesh [x,y,z]=sphere(40); Mesh(x,y,z) 321
322. 322. Figure 322 -1-0.500.51-1-0.500.51-1-0.500.51
323. 323. cylinder 323 -1-0.500.51-1-0.500.5100.20.40.60.81
324. 324. Cylinder(r,n) 324 -505-50500.20.40.60.81
325. 325. program [x,y,z]=cylinder(5,30); Mesh(x,y,z) 325
326. 326. figure 326 -505-50500.20.40.60.81
327. 327. program t = 0:pi/50:10*pi; plot3(sin(t),cos(t),t,‟r‟); Grid;axis square 327
328. 328. figure 328 -1-0.500.51-1-0.500.51010203040
329. 329. Pie,pie3 Subplot(211) pie([1 2 3 5],{'North','South','East','West'}) Subplot(212) pie3([2 4 3 5],[0 1 1 0],{'North','South','East','West'}) 329
330. 330. figure 330 NorthSouthEastWestEastWestSouthNorth
331. 331. program 331
332. 332. figure 332 11.522.53456700.5100.20.40.60.8100.5100.20.40.60.8100.5100.20.40.60.81
333. 333. program 333 rectangle('Position',[0.59,0.35,3.75,1.37],... 'Curvature',[0.8,0.4 ],... 'LineWidth',2,'LineStyle','--')
334. 334. figure 334 0.511.522.533.544.50.20.40.60.811.21.41.61.8
335. 335. program rectangle('Position',[0.59,0.35,3.75,1.37],... 'Curvature',[0 0],... 'LineWidth',2,'LineStyle','--') 335
336. 336. figure 336 0.511.522.533.544.50.20.40.60.811.21.41.61.8
337. 337. program clf;close all;clear all; rectangle('Position',[0.59,0.35,3.75,1.37],... 'Curvature',[1 1],... 'LineWidth',2,'LineStyle','--') 337
338. 338. Figure 338 0.511.522.533.544.50.20.40.60.811.21.41.61.8
339. 339. program clf;close all;clear all; rectangle('Position',[0.59,0.35,3.75,1.37],... 'Curvature',[1 1],... 'facecolor','g') 339
340. 340. figure 340 0.511.522.533.544.50.20.40.60.811.21.41.61.8
341. 341. program 341
342. 342. Figure 342 024681005100246810
343. 343. program 343
344. 344. Figure 344 0204002040-0.500.5020400102030-0.500.50204002040-0.500.50102030-0.500.5
345. 345. program 345
346. 346. Figure 346 05101520250102030-30-20-100102030
347. 347. Draw circles 347
348. 348. Result 348
349. 349. PROGRAM المطلوب هو عمل برنامج لوضع الاسم والدرجة والتقد رٌ كل واحدة ف مصفوفة و عٌرضهم 349
350. 350. 350
351. 351. functions Main program for i=1:10 disp(i) s(i) end Function s(i) for k=1:i fprintf(„*‟) end fprintf(„ „) 351