Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Brief Introduction to MATLAB Shibaji Shome and Rob MacLeod CVRTI University of Utah.

Similar presentations


Presentation on theme: "A Brief Introduction to MATLAB Shibaji Shome and Rob MacLeod CVRTI University of Utah."— Presentation transcript:

1 A Brief Introduction to MATLAB Shibaji Shome and Rob MacLeod CVRTI University of Utah

2 What is MATLAB? MATrix LABoratory (The MathWorks,Inc) Easy access to matrix computation software Scientific computing and Visualization package Arrays/matrices are at the heart of MATLAB All data are stored as arrays

3 Ok, but what is MATLAB? 1) Concept of Workspace 2) In-Built functions - commands 3) M-scripts 4) User-defined functions

4 Workspace Workspace initializes on launch Front end to MATLAB Access MATLAB functions Manage variables

5 Workspace Start MATLAB: Type “matlab” at system prompt / click application icon On starting MATLAB: * Matlab command window - your workspace * Matlab command prompt - interact

6 Commands In built functions Manage environment, variables, commands, functions Manage files, interact with the OS Perform computations, etc

7

8 M-Files or scripts Execute a batch of commands in a sequential manner. Compartmentalize your commands, organize them into a M-file. All variables and results are global ie can be accessed from the workspace. Name your m-file (with a.m extension), execute at command prompt by just typing the filename.

9

10 Functions Essentially user defined commands. Accept inputs from the workspace or another function/command. Output to workspace or output becomes input to another command/function. Encapsulation of variables. Only the outputs of a function are global. A function can call other functions within it, make calls to itself recursively. Structures your program, makes it more flexible, manageable and easy to debug.

11


Download ppt "A Brief Introduction to MATLAB Shibaji Shome and Rob MacLeod CVRTI University of Utah."

Similar presentations


Ads by Google