matlab programming for engineers ppt and matlab programming ppt and matlab simulink tutorial ppt for beginners
Introduction to Matlab Programming with
Department of Computer Science and Information Engineering
National Taiwan University
Winter Break, 2015Class Information
Ocial Web page
Lecture notes will be uploaded right before class.
Note that the lecture notes are organized in English.
If you have any question, please contact me via email.
Zheng-Liang Lu 1/48Prerequisites
No programming experience required.
It would be helpful if you have some programming experiences.
Linear Algebra is strongly recommended.
MATLAB refers to MATrix LABoratory.
Linear Algebra is widely used in numerical analysis and
Please be informed that you should consider other classes if
you want to learn any advanced computer science courses.
I promise to keep everythingsimple in this class.
Zheng-Liang Lu 2/48Grading
To pass the class, you need at least60 pts in the end of
Programming assignment (40 pts)
Final project/exam (60 pts)
Please be noted that you preserve the right to refund before
the 5th lecture.
Zheng-Liang Lu 3/48Final Project
Topic: anything if you are interested in or working on.
Requirement: you should use MATLAB as the main
Your grade depends on the following aspects:
Solve a problem by formulating the problem, organizing into an
algorithm, implementing a program by MATLAB
Get familiar with programming concepts
Gain the experiences in order to learn more programming
language by yourself.
Zheng-Liang Lu 4/48Final Exam
No communication with classmates and your friends
Zheng-Liang Lu 5/48Who/How/Why
Zheng-Liang Lu 6/48Articles about Learning Programming
5 REASONS YOU NEED TO LEARN TO PROGRAM
The reason everyone should learn to code
Why Learn to Program?
Zheng-Liang Lu 7/48Programs
A (computer) program is a sequence of instructions, written in an
articial language, to perform a specied task with a computer.
They are almost everywhere such that you can name it.
Operating systems, such as Windows 8.1, UNIX/Linux,
Android (family), OS X and iOS
Social networking, such as facebook, twitter, and so on
The dierences are the goal and functionality.
Zheng-Liang Lu 8/48How and Where The Programs Run
The programs are activated from the disk into the main
Now we call them the processes.
All the instructions with data are executed in the registers in
The results are written back to the main memory and further
stored into the disk after the processes are terminated.
Zheng-Liang Lu 9/483
See Bryant, p. 14.
Zheng-Liang Lu 10/48Programming Languages
A programming language is an articial language designed to
communicate with a machine by instructions.
Programming languages syntax + semantics
Used to express algorithms
Used to control the behavior of a machine
Zheng-Liang Lu 11/48How Many Programming Languages?
More than 100
In historical perspective,
1st generation: machine code
2nd generation: assembly code
3rd generation: high-level programming languages
Beyond 3rd generation
MATLAB belongs to post-3rd-generation programming
You can refer to TIOBE Programming Community Index.
Zheng-Liang Lu 12/48Zheng-Liang Lu 13/481st-Generation Programming Languages
A 1st-generation programming language is a machine-level
The instructions are made of binary numbers, represented by
1s and 0s.
There was originally no compiler or assembler to process the
Zheng-Liang Lu 14/48Pros:
Most ecient for machines
Hard to program for human
Still widely (and occasionally) used in programming lower
level functions of the system, such as drivers, interfaces with
rmware and hardware devices.
Aka machine code.
Zheng-Liang Lu 15/482nd-Generation Programming Languages
2nd-generation programming language is a generational way
to categorize assembly languages.
The code can be read and written by a programmer.
Yet, it is still machine-dependent.
To run on a computer, it must be converted into a machine
readable form, a process called assembly.
More often nd use in extremely intensive processing such as
games, video editing, graphic manipulation/rendering.
Zheng-Liang Lu 16/483rd-Generation Programming Languages
A 3rd-generation language aims to be closer to the human
Instructions operate at a higher, abstract level, closer to the
human way of thinking.
Each individual instruction can be translated into a number of
machine-level instruction via a specic compiler.
More friendly to understand, easier to learn
Support structured programming
5 6 7
Such as C , C++ , and Java
Aka high-level programming languages
Zheng-Liang Lu 17/48What Can A Program Do?
A program is an implementation of an algorithm expressed in a
specic programming language.
Zheng-Liang Lu 18/48Algorithm In A Nutshell
An algorithm is a sequence of unambiguous instructions for
solving a problem, that is, for obtaining a required output for any
legitimate input in a nite amount of time.
Simply put, an algorithm is a procedure that solves a
particular type of problems, such as a cookbook.
See Algorithm in Wikipedia.
Zheng-Liang Lu 19/48