Question? Leave a message!

Introduction to Matlab Programming with Applications

Introduction to Matlab Programming with Applications 4
LottieBarners Profile Pic
Published Date:12-07-2017
Website URL
Introduction to Matlab Programming with Applications Zheng-Liang Lu Department of Computer Science and Information Engineering National Taiwan University Matlab-249 Winter Break, 2015Class Information Ocial Web page Lecture notes will be uploaded right before class. Note that the lecture notes are organized in English. Contact information If you have any question, please contact me via email. facebook 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 quantitative methods. 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 class. Programming assignment (40 pts) Final project/exam (60 pts) 1 Please be noted that you preserve the right to refund before the 5th lecture. 1 Zheng-Liang Lu 3/48Final Project Topic: anything if you are interested in or working on. Requirement: you should use MATLAB as the main programming language. Your grade depends on the following aspects: Problem de nition 2 Innovation Completion Goal: 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. 2 No copy-and-paste. Zheng-Liang Lu 4/48Final Exam On-site programming 10 questions Open everything 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? ºÀ¼x. ž? Zheng-Liang Lu 7/48Programs A (computer) program is a sequence of instructions, written in an arti cial language, to perform a speci ed task with a computer. They are almost everywhere such that you can name it. For example, Computer virus Games 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 di erences 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 memory. Now we call them the processes. All the instructions with data are executed in the registers in CPUs. 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 Memory Hierarchy 3 See Bryant, p. 14. Zheng-Liang Lu 10/48Programming Languages A programming language is an arti cial 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 4 MATLAB belongs to post-3rd-generation programming languages. You can refer to TIOBE Programming Community Index. 4 1984 Zheng-Liang Lu 12/48Zheng-Liang Lu 13/481st-Generation Programming Languages A 1st-generation programming language is a machine-level programming language. Machine-dependent The instructions are made of binary numbers, represented by 1s and 0s. There was originally no compiler or assembler to process the instructions. Zheng-Liang Lu 14/48Pros: Most ecient for machines Cons: Hard to program for human Not portable 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 domain. 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 speci c compiler. Summary: More friendly to understand, easier to learn Portable, machine-independent Support structured programming 5 6 7 Such as C , C++ , and Java Aka high-level programming languages 5 1973 6 1983 7 1995 Zheng-Liang Lu 17/48What Can A Program Do? A program is an implementation of an algorithm expressed in a speci c programming language. Zheng-Liang Lu 18/48Algorithm In A Nutshell 8 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. 8 See Algorithm in Wikipedia. Zheng-Liang Lu 19/48