m a t l a b
DESCRIPTION
M A T L A B. Eng. Osama Talaat osama063 @msn.com Faculty of Engineering, Zagazig University, Egypt 2013. Course Web Page. www.osamatalaat.com/matlab You can also navigate to it by: www.osamatalaat.com >> Teaching >> Matlab. You shall find lecture materials and course resources. - PowerPoint PPT PresentationTRANSCRIPT
1 M A T L A BEng. Osama Talaat
Faculty of Engineering, Zagazig University, Egypt 2013
2 Course Web Page
www.osamatalaat.com/matlab You can also navigate to it by:
www.osamatalaat.com >> 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.
3 About MATLAB
Calculator
Programming Language
Toolboxes
Simulation
Solving EquationsMatricesGraphs
CommunicationControl SystemsImage Processing
Simulink
Console programsGUI
4Lecture (1)
IntroductionEng. Osama Talaat
5 MATLAB R2013a Latest version – Download from the webpage.
6 MATLAB Setup
OpenMATLAB
7 Arithmetic Operators
10 + 2
10 – 2
10 × 2
8 Arithmetic Operators
102
10 2
/ \
9 Layout: Command Window Clear command window using GUI
Clear command window using Commands
>> clc
10 Layout: Command History
Clear command history
11 Layout Controllers Undock Dock
Maximize Restore.
Minimize Restore.
Move the tab.
12 Variables
قيمة مباشرة
ناتج عملية حسابية
متغير من آخر
13 Variables
متغير من نفسه
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.
14 Note: Simi-Colon (;)
15Note: Multiplying by
variable
No implicit multiplying sign
16 Layout: Workspace
Save variables …
17 Layout: Current Directory Current Directory
address bar.
Change Current Directory.
18 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
19 Special Values: ans
ناتج آخر
عملية حسابية لم يتم
تخزينها
20 Special Values: PI, INF
Infinity
21 Special Values: NaN
كميةغير
محددة
22 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)
Radian by default
Degrees
23 Inverse Trigonometric Functions
Radian Degrees Maths
>> asin(x) >> asind(x)
>> acos(x) >> acosd(x)
>> atan(x) >> atand(x)
>> asec(x) >> asecd(x)
>> acsc(x) >> acscd(x)
>> acot(x) >> acotd(x)
24 Hyperbolic Functions>> sinh(x)
>> cosh(x)
>> tanh(x)
>> sech(x)
>> csch(x)
>> coth(x)
>> asinh(x)
>> acosh(x)
>> atanh(x)
>> asech(x)
>> acsch(x)
>> acoth(x)
25 Other Mathematical Functions
>> log10(100)
>> log2(1024)
>> log(3)
>> exp(3)
>> abs(-12)
>> sqrt(16)
>> nthroot(27,3)
26 Test yourself If x=1 calculate the following:
>> x=1;
>> f=( 5*log10(x)+2*x^3*sin(x)+log(x)*sqrt(x) ) / ( exp(6*x^2)+3*x^4+cos(x) )
f =
0.0041
27 Other Mathematical Functions
إيجاد األعداد األولية حتى
10الرقم
اختبارهل
العدد أولي أم ال
28 Other Mathematical Functions
تحليل العدد إلى مكوناته األولية
مضروب العدد
29 Complex Numbers
i or j
30 Complex Numbers
Using i or j as
variables
implicit multiplying
sign
31 Complex Numbers
القيمة المطلقة للعدد
المركب
زاوية العدد المركب
المرافق
32 Complex Numbers
الجزء الحقيقي
الجزء التخيلي
اختبار وجود جزء تخيلي من
عدمه
33 Complex Numbers
34 Approximation Functions
Normal
Approximation
35 Approximation Functions
Round
towards
positive
infinity
36 Approximation Functions
Round
towards
negative
infinity
37 Approximation Functions
Round
towards
Zero
38 Approximation Functions
Round
towards
Zero
39 Help !! Demos.
40 MATLAB Tips>> bench
41GOOD LUCK
To be continued in the next lecture …