Winter Semester 2014/2015 College of Engineering
Syllabus Instructor: Prof. M. Asif - Room 2B45 - Tel: Credit hours: 3 Office Hours: see office hours schedule posted Goals Learn the fundamentals of programming using Matlab Textbooks & reference materials Amos GILAT, MATLAB an Introduction with Applications, John Wiley&Sons Inc. 4 th Edition Hoboken, New Jersey, USA 2011 David Houcque, Introduction to Matlab for engineering students, class- notes,Northwestern University. (version 1.2, August 2005) Tools: The required software and hardware will be available in the college of engineering computer labs.
Syllabus : Outline WeekTopics 1 – 2 INTRODUCE Introduction to programming Introduction to the MATLAB environment Introducing the command window, the script editor 3 – 4 USING THE MATLAB ENVIRONMENT Data types, Constants, Variables Operators and Built-In Functions, assignment statements Types of errors 5 – 6 ALL ABOUT ARRAYS Arrays in MATLAB Matrices and matrix operations 7-8 ALL ABOUT PLOTTING Plotting with MATLAB Managing plots Multiple plots (MID-TERM EXAM)
Syllabus : Outline WeekTopics 10 – 11 WRITING PROGRAMS IN SCRIPT FILES Script Files / Data files Program composition and format Algorithms Simple Input/Output Formatted output 9 – 10 CONTROL TECHNIQUES IF constructs FOR loops WHILE loops 12 – 14 GOING BEYOND Programming with functions Applications
Syllabus : Grading Computer Labs (15%) In-class instructor’s grades (15%) Mid-term exams (30 %) Final exam (40 %) Important note : The Mid-Term Exam for GE 209 will be held on XXXX, XXXXXXX( ( إن شاء الله This date is reserved for all sections (GE209) and in no way it will be changed !!!
7 MATLAB Resources (latest Release R2014b) Getting Started – html document on Mathworks web site – /helpdesk/help/helpdesk.shtml –Click on “Getting Started” –Click on “This manual in PDF” Open or save to disk Help from MATLAB program Practice and learn from each other g-started-with-matlab html
8 A snap shot of the MATLAB working environment Command Window Command History Workspac e Command Window type commands Current Directory View folders and m-files Workspace View program variables Double click on a variable to see it in the Array Editor Command History view past commands save a whole session using diary
The Commands Window Command Window Recognizable by the Command prompt >> Basic arithmetic operations are available: addition + subtraction – division / multiplication * exponentiation ^ More complex operations and programming instructions Pressing “enter” key “executes” or “runs” or “invokes” the operation
Arithmetic Operations Addition + >> 1+2 Subtraction->> 3-4 Multiplication*>> 5*6 Division/>> 7/8 Back Slash\>> 9\10 or 10/9 Exponentiation^>> 2^3 Priority rule : PEMDAS (Parentheses, Exponentiation, Multiplication, Division, Addition, Subtraction) >> ((2+5)^2+2*2-10/5) = ?
Priority rules Precedence is the order operations are preformed, remember PEMDAS >> ((2+5)^2+2*2-10/5) innermost parentheses is done first 7^2 exponentiation is next 2*2 or 10/5 multiplication or division next ( – 2) addition or subtraction next Operations are done from left to right final result gives 51