<<

System Design

S.CS301

(Autumn 2015/16) Page 1 S.CS301: Lecture 01 Agenda

 Contents:  Course overview  Reading materials  What is the MATLAB?  MATLAB system  History of MATLAB  License of MATLAB  Release history  Syntax of MATLAB

(Autumn 2015/16) Page 2 S.CS301: Lecture 01 Course overview

Lecture 32 hours, 1 time per week Laboratory 32 hours 1 time per 2 weeks

(Autumn 2015/16) Page 3 S.CS301: Lecture 01 Reading materials

 Ж.Дашдорж, Д.Халзаа, Ууганбаяр, Ц.Ганбат

 Internet resources: key words “Matlab tutorial for beginners”, “Matlab for beginner”, “Matlab lecture note”, “how to learn Matlab” etc.

 Library of MUST

 Blog of lecturer http://uranchimeg.com/Education/

(Autumn 2015/16) Page 4 S.CS301: Lecture 01 What is the Matlab?

MATLAB is a high-performance language for technical computing. It integrates computation, visualization, and programming in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation. Typical uses include:

 Math and computation

development

 Modeling, simulation, and prototyping

 Data analysis, exploration, and visualization

 Scientific and engineering graphics

 Application development, including Graphical building

Source: http://cimss.ssec.wisc.edu/wxwise/class/aos340/spr00/whatismatlab.htm

(Autumn 2015/16) Page 5 S.CS301: Lecture 01 What is the Matlab? Cont…

MATLAB is an interactive system whose data element is an array that does not require dimensioning. This allows you to solve many technical computing problems, especially those with and vector formulations, in a fraction of the time it would take to write a program in a noninteractive language such as or . The name MATLAB stands for matrix laboratory. MATLAB was originally written to provide easy access to matrix software developed by the LINPACK and EISPACK projects, which together represent the state-of-the-art in software for matrix computation. MATLAB has evolved over a period of years with input from many users. In university environments, it is the standard instructional tool for introductory and advanced courses in mathematics, engineering, and science. In industry, MATLAB is the tool of choice for high-productivity research, development, and analysis. (Autumn 2015/16) Page 6 S.CS301: Lecture 01 What is the Matlab? Cont…

MATLAB features a family of application-specific solutions called toolboxes. Very important to most users of MATLAB, toolboxes allow you to learn and apply specialized technology. Toolboxes are comprehensive collections of MATLAB functions (M-files) that extend the MATLAB environment to solve particular classes of problems. Areas in which toolboxes are available include processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and many others.

Source: http://cimss.ssec.wisc.edu/wxwise/class/aos340/spr00/whatismatlab.htm Figure: James Brucker (Autumn 2015/16) Page 7 S.CS301: Lecture 01 The MATLAB System

The MATLAB system consists of five main parts: The MATLAB language. This is a high-level matrix/array language with statements, functions, data structures, input/output, and object-oriented programming features. It allows both "programming in the small" to rapidly create quick and dirty throw-away programs, and "programming in the large" to create complete large and complex application programs. The MATLAB working environment. This is the set of tools and facilities that you work with as the MATLAB user or . It includes facilities for managing the variables in your workspace and importing and exporting data. It also includes tools for developing, managing, debugging, and profiling M-files, MATLAB's applications.

(Autumn 2015/16) Page 8 S.CS301: Lecture 01 The MATLAB System Cont…

Handle Graphics. This is the MATLAB graphics system. It includes high-level commands for two-dimensional and three-dimensional data visualization, image processing, animation, and presentation graphics. It also includes low-level commands that allow you to fully customize the appearance of graphics as well as to build complete Graphical User Interfaces on your MATLAB applications. The MATLAB mathematical library. This is a vast collection of computational ranging from elementary functions like sum, sine, cosine, and complex arithmetic, to sophisticated functions like matrix inverse, matrix eigenvalues, Bessel functions, and fast Fourier transforms.

(Autumn 2015/16) Page 9 S.CS301: Lecture 01 The MATLAB System Cont…

The MATLAB Application Program Interface (API). This is a library that allows you to write C and Fortran programs that interact with MATLAB. It include facilities for calling routines from MATLAB (dynamic linking), calling MATLAB as a computational engine, and for reading and writing MAT-files.

Source: http://cimss.ssec.wisc.edu/wxwise/class/aos340/spr00/whatismatlab.htm

(Autumn 2015/16) Page 10 S.CS301: Lecture 01 History of Matlab

Cleve Moler, the chairman of the computer science department at the University of New Mexico, started developing MATLAB in the late 1970s. He designed it to give his students access to LINPACK and EISPACK without them having to learn Fortran. It soon spread to other universities and found a strong audience within the applied mathematics community. Jack Little, an engineer, was exposed to it during a visit Moler made to in 1983. Recognizing its commercial potential, he joined with Moler and Steve Bangert. They rewrote MATLAB in C and founded MathWorks in 1984 to continue its development. These rewritten libraries were known as JACKPAC. In 2000, MATLAB was rewritten to use a newer set of libraries for matrix manipulation, LAPACK. MATLAB was first adoped by researchers and practitioners in control engineering, Little's specialty, but quickly spread to many other domains. It is now also used in education, in particular the teaching of , , and is popular amongst scientists involved in image processing.

Source: https://en.wikipedia.org/wiki/MATLAB#License (Autumn 2015/16) Page 11 S.CS301: Lecture 01 License

MATLAB is a proprietary product of MathWorks, so users are subject to vendor lock-in.[3][35] Although MATLAB Builder products can deploy MATLAB functions as library files which can be used with .NET[36] or [37] application building environment, future development will still be tied to the MATLAB language. Each toolbox is purchased separately. If an evaluation license is requested, the MathWorks sales department requires detailed information about the project for which MATLAB is to be evaluated. If granted (which it often is), the evaluation license is valid for two to four weeks. A student version of MATLAB is available as is a home-use license for MATLAB, , and a subset of Mathwork's Toolboxes at substantially reduced prices. It has been reported that EU competition regulators are investigating whether MathWorks refused to sell licenses to a competitor.[38] (Autumn 2015/16) Page 12 S.CS301: Lecture 01 Alternatives

MATLAB has a number of competitors. Commercial competitors include Mathematica, TK Solver, , and IDL. There are also free open source alternatives to MATLAB, in particular GNU Octave, , FreeMat, Julia, and Sage which are intended to be mostly compatible with the MATLAB language. Among other languages that treat arrays as basic entities ( languages) are APL, Fortran 90 and higher, S-Lang, as well as the statistical languages and S. There are also libraries to add similar functionality to existing languages, such as IT++ for C++, Data Language for Perl, ILNumerics for .NET, /SciPy for Python, and Numeric.js for JavaScript. GNU Octave is unique from other alternatives because it treats incompatibility with MATLAB as a bug (see MATLAB Compatibility of GNU Octave). Therefore, GNU Octave attempts to provide a software of MATLAB.

(Autumn 2015/16) Page 13 S.CS301: Lecture 01 Release history

(Autumn 2015/16) Page 14 S.CS301: Lecture 01 Release history Cont..

(Autumn 2015/16) Page 15 S.CS301: Lecture 01 Release history Cont..

(Autumn 2015/16) Page 16 S.CS301: Lecture 01 Release history Cont..

(Autumn 2015/16) Page 17 S.CS301: Lecture 01 Release history Cont..

(Autumn 2015/16) Page 18 S.CS301: Lecture 01 Release history Cont..

(Autumn 2015/16) Page 19 S.CS301: Lecture 01 Syntax - Variables

Variables are defined using the assignment operator, =. MATLAB is a weakly typed because types are implicitly converted. It is an inferred typed language because variables can be assigned without declaring their type, except if they are to be treated as symbolic objects, and that their type can change. Values can come from constants, from computation involving values of other variables, or from the output of a function

(Autumn 2015/16) Page 20 S.CS301: Lecture 01 Syntax - Vectors and matrice

(Autumn 2015/16) Page 21 S.CS301: Lecture 01 Syntax - Vectors and matrice Cont…

(Autumn 2015/16) Page 22 S.CS301: Lecture 01 Syntax - Vectors and matrice Cont…

(Autumn 2015/16) Page 23 S.CS301: Lecture 01 Syntax - Vectors and matrice Cont…

(Autumn 2015/16) Page 24 S.CS301: Lecture 01 Syntax – Structure and Function

(Autumn 2015/16) Page 25 S.CS301: Lecture 01 Syntax – Classes and OOP

(Autumn 2015/16) Page 26 S.CS301: Lecture 01 Graphics and programming

MATLAB supports developing applications with graphical user interface features. MATLAB includes GUIDE[19] (GUI development environment) for graphically designing GUIs.[20] It also has tightly integrated graph- plotting features. For example, the function plot can be used to produce a graph from two vectors x and y.

(Autumn 2015/16) Page 27 S.CS301: Lecture 01 GUI Cont…

(Autumn 2015/16) Page 28 S.CS301: Lecture 01 What we learned today?

 Course overview  Reading materials  What is the MATLAB?  MATLAB system  History of MATLAB  License of MATLAB  Release history  Syntax of MATLAB

(Autumn 2015/16) Page 29 S.CS301: Lecture 01 End of

Any questions?

(Autumn 2015/16) Page 30 S.CS301: Lecture 01