Presentation is loading. Please wait.

Presentation is loading. Please wait.

NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 2 : Matlab - Getting Started.

Similar presentations


Presentation on theme: "NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 2 : Matlab - Getting Started."— Presentation transcript:

1 NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 2 : Matlab - Getting Started Networks and Communication Department 1

2 Lecture Contents Networks and Communication Department  Getting Started.  The MATLAB Desktop.  Command window.  Command History window.  Current Folder window.  Workspace window.  Matlab menu bar. 2

3 Matrix Laboratory Networks and Communication Department 3  Matlab = Matrix Laboratory  A software environment for interactive numerical computations  Examples:  Matrix computations and linear algebra  Solving nonlinear equations  Numerical solution of differential equations  Mathematical optimization  Statistics and data analysis  Signal processing  Modelling of dynamical systems  Solving partial differential equations  Simulation of engineering systems

4 MATLAB Toolboxes Networks and Communication Department 4  MATLAB has a number of add-on software modules, called toolboxes, that perform more specialized computations.  Signal & Image Processing Signal Processing- Image Processing Communications – System Identification - Wavelet Filter Design  Control Design Control System - Fuzzy Logic - Robust Control - μ -Analysis and Synthesis - LMI Control Model Predictive Control More than 60 toolboxes!

5 Simulink Networks and Communication Department 5  Simulink - a package for modeling dynamic systems.

6 Simulink (Cont.) Networks and Communication Department 6  Analyzing results:

7 Getting Started. Networks and Communication Department 7  MATLAB offers engineers, scientists, and mathematicians an intuitive language for expressing problems and their solutions mathematically and graphically.  It integrates computation, visualization, and programming in a flexible, open environment.  Complex numeric and symbolic problems can be solved in a fraction of the time required with other languages such as C, Fortran, or Java.

8 The MATLAB Desktop Networks and Communication Department 8  MATLAB has an extensive graphical user interface. When MATLAB starts, the main MATLAB window appears.  The Desktop menu controls the layout and appearance of the windows and gives you a list of the windows you can use.

9 Networks and Communication Department 9

10 10 The MATLAB environment is command oriented

11 Networks and Communication Department 11 The first four appear by default, the first time you use MATLAB.

12 Networks and Communication Department 12 The Start button in the bottom left corner of the MATLAB Desktop brings up demos, tools, and other windows.

13 Networks and Communication Department 13 All MATLAB windows are docked in the default desktop, which means that they are tiled on the main MATLAB window. Docked window Undocked window

14 Command window Networks and Communication Department 14 MATLAB expressions and statements are evaluated as you type them in the Command Window, and results of the computation are displayed there too.

15 Command window Networks and Communication Department 15  MATLAB expressions and statements are evaluated as you type them in the Command Window, and results of the computation are displayed there too.  Expressions and statements are also used in M-files (see it later).  They are usually of the form: or simply:

16 Command window (Cont.) Networks and Communication Department 16  Expressions are usually composed from operators, functions, and variable names.  Evaluation of the expression produces a matrix (or other data type), which is then displayed on the screen or assigned to a variable for future use.  If the variable name and = sign are omitted, a variable ans (for answer) is automatically created to which the result is assigned.

17 Command window (Cont.) Networks and Communication Department 17  A statement is normally terminated at the end of the line. However, a statement can be continued to the next line with three periods (...) at the end of the line.  Several statements can be placed on a single line separated by commas or semicolons.  MATLAB is case-sensitive in the names of commands, functions, and variables, so A and a are two different variables.

18 Command window (Cont.) Networks and Communication Department 18  A comma or blank separates the elements within a row of a matrix (sometimes a comma is necessary to split the expressions, because a blank can be ambiguous).  A semicolon ends a row.

19 Command window (Cont.) Networks and Communication Department 19  You can save the Command Window dialog with the diary command:  This causes what appears subsequently in the Command Window to be written to the named file (if the filename is omitted, it is written to a default file named diary) until you type the command diary off; the command diary on causes writing to the file to resume.  When finished, you can edit the file as desired and print it out.

20 Command window (Cont.) Networks and Communication Department 20  Tab completion is another helpful shortcut. It works in both the Command Window and the Editor.  Start typing a command name, a variable name, or a filename. Before you type it all in, hit the tab key. Try typing z then a tab. A list of all the functions and variables that start with z will pop up. Select one from the list, or keep typing to narrow down the selection.

21 Command window (Cont.) Networks and Communication Department 21  You can clear the Command Window with the clc command or with Edit > Clear Command Window.

22 Command History window Networks and Communication Department 22 This window lists the commands typed in so far. You can re-execute one more commands from this window by double-clicking or dragging the command(s) into the Command Window.

23 Current Folder window Networks and Communication Department 23 The Current Folder window displays a list of the files in your current folder. The name of this folder also appears at the top of the main MATLAB window, in the MATLAB Toolbar. Your current folder is the first place MATLAB looks for your M-files, and for workspace (.mat) files containing data that you load and save. MATLAB also looks in all the folders in your MATLAB path. Folders that are not on your MATLAB path are shown in gray.

24 Current Folder window (Cont.) Networks and Communication Department 24  The commands: pwd returns the name of the current folder. cd changes the current folder. dir lists the contents of the current folder, what lists only the MATLAB-specific files in the folder grouped by file type. delete and type can be used to delete a file and display a file in the Command Window, respectively.

25 Workspace window Networks and Communication Department 25 The Workspace window lists variables that you have either entered or computed in your MATLAB session.

26 Workspace window (Cont.) Networks and Communication Department 26  All the matrices and other variables that you create, except those internal to M-files, are shown in your Workspace window.  Double-clicking on a variable in the Workspace window pulls up the Variable Editor.

27 Workspace window (Cont.) Networks and Communication Department 27  The command: whos lists the variables currently in the workspace. clear variablename clear a variable or a function from the workspace. (or by right-clicking the variable in the Workspace window and selecting Delete) clear clears all variables from the workspace.

28 Workspace window (Cont.) Networks and Communication Department 28  When you log out or exit MATLAB, all variables are lost. However, invoking the command save before exiting writes all variables to a binary file named matlab.mat in the current folder.  When you later reenter MATLAB, the command load restores the workspace to its former state.

29 Matlab menu bar Networks and Communication Department 29

30 Matlab menu bar(Cont.) Networks and Communication Department 30

31 Matlab menu bar (Cont.) Networks and Communication Department 31

32 Matlab menu bar (Cont.) Networks and Communication Department 32

33 Matlab menu bar (Cont.) Networks and Communication Department 33

34 Matlab menu bar (Cont.) Networks and Communication Department 34

35 Matlab menu bar (Cont.) Networks and Communication Department 35

36 Some Useful MATLAB commands Networks and Communication Department 36

37 Math Networks and Communication Department 37  MATLAB can do simple math just as a calculator.

38 Interactive Calculations Networks and Communication Department 38  Matlab is interactive, no need to declare variables.  Most elementary functions and constants are already defined.

39 Functions Networks and Communication Department 39  MATLAB has many built-in functions.  Some math functions are:

40 The Help System Networks and Communication Department 40

41 The help system example Networks and Communication Department 41

42 MATLAB Variable Names Networks and Communication Department 42  Variable names ARE case sensitive  Variable names can contain up to 63 characters (as of MATLAB 6.5 and newer)  Variable names must start with a letter followed by letters, digits, and underscores.

43 MATLAB Special Variables Networks and Communication Department 43

44 MATLAB Math & Assignment Operators Networks and Communication Department 44

45 Any Questions ? The End 45 Networks and Communication Department


Download ppt "NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 2 : Matlab - Getting Started."

Similar presentations


Ads by Google