M A T L A B Eng. Osama Talaat Faculty of Engineering, Zagazig University, Egypt
Course Web Page You can also navigate to it by: >> Teaching >> Matlab. You shall find lecture materials and course resources. Bookmark this page and keep visiting it regularly after each lecture to download its material. 2
About MATLAB Calculator Programming Language Toolboxes Simulation 3 Solving Equations Matrices Graphs Communication Control Systems Image Processing Simulink Console programs GUI
Lecture (1) Introduction Eng. Osama Talaat 4
MATLAB R2013a Latest version – Download from the webpage. 5
MATLAB Setup 6 Open MATLAB
Arithmetic Operators – 2 10 × 2 7
Arithmetic Operators 10 2 / \ 8
Layout: Command Window Clear command window using GUI Clear command window using Commands >> clc 9
Layout: Command History Clear command history 10
Layout Controllers 11
Variables 12 قيمة مباشرة ناتج عملية حسابية متغير من آخر
Variables 13 متغير من نفسه NB: Names (variables, files, …) characters & Numbers, but starts with char. No spaces. No symbols except underscores (_). Case sensitive (also commands). Maximum length = 64 (increasing value). NB: display variable value.
Note: Simi-Colon (;) 14
Note: Multiplying by variable 15 No implicit multiplying sign
Layout: Workspace Save variables … 16
Layout: Current Directory Current Directory address bar. Change Current Directory. 17
Layout: Workspace Save variables: Ctrl + S GUI Code >> save osama.mat Clear workspace using GUI and Code. >> clear a >> clear b c >> clear Load saved variables: Ctrl + O Code >> load osama.mat 18
Special Values: ans 19 ناتج آخر عملية حسابية لم يتم تخزينها
Special Values: PI, INF 20
Special Values: NaN 21 كمية غير محددة
Trigonometric Functions >> sin(x) >> cos(x) >> tan(x) >> sec(x) >> csc(x) >> cot(x) >> sind(x) >> cosd(x) >> tand(x) >> secd(x) >> cscd(x) >> cotd(x) 22 Radian by default Degrees
Inverse Trigonometric Functions 23 RadianDegreesMaths >>asin(x)>>asind(x) >>acos(x)>>acosd(x) >>atan(x)>>atand(x) >>asec(x)>>asecd(x) >>acsc(x)>>acscd(x) >>acot(x)>>acotd(x)
Hyperbolic Functions 24 >> sinh(x) >> cosh(x) >> tanh(x) >> sech(x) >> csch(x) >> coth(x) >> asinh(x) >> acosh(x) >> atanh(x) >> asech(x) >> acsch(x) >> acoth(x)
Other Mathematical Functions 25 >> log10(100) >> log2(1024) >> log(3) >>exp(3) >> abs(-12) >>sqrt(16) >>nthroot(27,3)
Test yourself 26
Other Mathematical Functions 27 إيجاد الأعداد الأولية حتى الرقم 10 اختبار هل العدد أولي أم لا
Other Mathematical Functions 28 تحليل العدد إلى مكوناته الأولية
Complex Numbers 29 i or j
Complex Numbers 30 Using i or j as variables implicit multiplying sign
Complex Numbers 31 القيمة المطلقة للعدد المركب زاوية العدد المركب المرافق
Complex Numbers 32 الجزء الحقيقي الجزء التخيلي اختبار وجود جزء تخيلي من عدمه
Complex Numbers 33
Approximation Functions 34 Normal Approximation
Approximation Functions 35 Round towards positive infinity
Approximation Functions 36 Round towards negative infinity
Approximation Functions 37 Round towards Zero
Approximation Functions 38 Round towards Zero
Help !! Demos. 39
MATLAB Tips >> bench 40
GOOD LUCK To be continued in the next lecture … 41