Introduction to MATLAB PDF

Title Introduction to MATLAB
Course Feedback control systems
Institution National University of Computer and Emerging Sciences
Pages 5
File Size 238.1 KB
File Type PDF
Total Downloads 102
Total Views 143

Summary

provides an introduction to MATLAB for the course of control systems...


Description

Experiment No 1 Introduction to MATLAB MATLAB stands for “matrix laboratory”. MATLAB is a software system for numerical computations and graphics. It performs numerical calculations. It is especially designed for matrix computations like solving systems of linear equations. It has a variety of graphical capabilities and can be extended through programs written in its own programming language. MATLAB is

a multi-paradigm numerical

computing environment

and fourth-generation

programming language, developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing

with

programs

written

in

other

languages,

including C, C++, Java,Fortran and Python. Although MATLAB is intended primarily for numerical computing, an optional toolbox uses the MuPAD symbolic engine, allowing access to symbolic computing capabilities. An additional package, Simulink,

adds

graphical

multi-domain

simulation

and Model-Based

Design for dynamic and embedded systems. In 2004, MATLAB had around one million users across industry and academia. MATLAB users come from various backgrounds of engineering, science, and economics. MATLAB is widely used in academic and research institutions as well as industrial enterprises. How to start: Enter MATLAB by double-clicking on the MATLAB shortcut icon (MATLAB 7.0.4) on your Windows desktop. When you start MATLAB, a special window called the MATLAB desktop appears. The desktop is a window that contains other windows. The major tools within or accessible from the desktop are: 

The Command Window



The Command History



The current folder Page 1 of 5

Figure 1: The graphical interface to the MATLAB workspace

Table 1-1: Window

Purpose

Command window main window, enter variables, run programs Command history

window & logs commands entered in the command window

Current Folder

shows the files in the current directory

Creating Variable: Variables: 1. Names: 

Can be any string of upper and lower case letters along with numbers and underscores but it must begin with a letter



Reserved names are IF, WHILE, ELSE, END, SUM, etc.

Page 2 of 5



Names are case sensitive

2. Value: 

This is the data the is associated to the variable; the data is accessed by using the name.

Useful functions and operations in MATLAB: Here is a table of useful operations, functions and constants in MATLAB. Table 1-2: Operation, function or constant

MATLAB command

+ (addition)

+

- (subtraction)

-

× (multiplication)

*

/ (division)

/

|x| (absolute value of x)

abs(x)

square root of x

sqrt(x)

ex

exp(x)

ln x (natural log)

log(x)

log10 x (base 10 log)

log10(x)

sin x

sin(x)

cos x

cos(x)

tan x

tan(x)

cot x

cot(x)

arcsin x

asin(x)

arccos x

acos(x)

arctan x

atan(x)

Page 3 of 5

arccot x

acot(x)

n! (n factorial)

gamma(n+1)

e (2.71828...)

exp(1)

(3.14159265...)

pi

i (imaginary unit, sqrt(-1))

i

Logical Operators: You can use Logical Indexing to find data that conforms to some limitations. Logical Operators: 1. Greater Than: > 2. Less Than: < 3. Greater Than or Equal To: >= 4. Less Than or Equal To: > clear Variable_Name

Quitting MATLAB: To end your MATLAB session, type quit in the Command Window, or select File Exit MATLAB in the desktop main menu.

Page 5 of 5...


Similar Free PDFs