Anda di halaman 1dari 5

EXPERIMENT 1

INTRODUCTION TO MATLAB
MATLAB is a high-level language and interactive environment for numerical computation,
visualization, and programming. Using MATLAB, you can analyze data, develop algorithms,
and create models and applications. The language, tools, and built-in math functions enable
you to explore multiple approaches and reach a solution faster than with spreadsheets or
traditional programming languages, such as C/C++ or Java. You can use MATLAB for a
range of applications, including signal processing and communications, image and video
processing, control systems, test and measurement, computational finance, and
computational biology. More than a million engineers and scientists in industry and
academia use MATLAB, the language of technical computing.
MATLAB is an abbreviation for "matrix laboratory." While other programming languages
usually work with numbers one at a time, MATLAB operates on whole matrices and arrays.
Language fundamentals include basic operations, such as creating variables, array indexing,
arithmetic, and data types.
Cleve Moler, the chairman of the computer science department at the University of New Mexico,
started developing MATLAB in the late 1970s.[4] He designed it to give his students access
to LINPACK and EISPACK without them having to learnFortran. 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 Stanford University 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.[5] In 2000, MATLAB was rewritten to use a newer set of
libraries for matrix manipulation, LAPACK.[6]
MATLAB was first adopted 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 linear algebra, numerical analysis, and is popular amongst scientists
involved in image processing.[4]

Key Features

High-level language for numerical computation, visualization, and application development

Interactive environment for iterative exploration, design, and problem solving

Mathematical functions for linear algebra, statistics, Fourier analysis, filtering, optimization,
numerical integration, and solving ordinary differential equations

Built-in graphics for visualizing data and tools for creating custom plots

Development tools for improving code quality and maintainability and maximizing
performance

Tools for building applications with custom graphical interfaces

Functions for integrating MATLAB based algorithms with external applications and
languages such as C, Java, .NET, and Microsoft Excel

COMMANDS

1. PLOT
Linear 2D Plot
Syntax
plot(Y)
plot(X1,Y1.)
plot(X1,Y1,LineSpec.)
plot(Property Name, Property Value.)
plot(axes,handle.)
h=plot(.)
hlines=plot(v6)

2. STEM
plot discrete sequence data
Syntax
stem(Y)
stem(X,Y)
stem(.,fill)
stem(.LineSpec)
stem(axes..handle)
h=stem()
hlines=stem(v6)

3. SUBPLOT
Create axes object in titled position
Syntax
subplot(m,n,p)
subplot(mnp)
subplot(m,n,p,replace)
subplot(m,n,p,align)
subplot(h)
subplot(position,[left bottom width height])
h=subplot()

4. ZEROS
Create an array of all zeros
Syntax
B=zeros(n)
B=zeros(m,n)
B=zeros([m,n])
B=zeros(d1,d2,d3..)
B=zeros([d1d2d3..])
B=zeros(size(A))
zeros(m,n.classname)
zeros([m,n,.[classname]])

5. TITLE
Add title to current axes
Syntax
title(string)
title(fname)
title(.ProgramName,Property Value)
title(axes,..handle)
h=title()

6. xlabel,ylabel,zlabel
Label the x-axis,y-axis,z-axis
Syntax
xlabel(string)
xlabel(fname)
xlabel(PropertyName,Property Value..)
xlabel(axes..handle..)
h=xlabel()

ylabel(PropertyName,Property Value..)
ylabel(axes..handle..)
h=ylabel()

zlabel(PropertyName,Property Value..)
zlabel(axes..handle..)
h=zlabel()

7. ONES
Create an array of all ones
Syntax
Y=ones(n)
Y=ones(m,n)
Y=ones([m,n])
Y=ones(d1,d2,d3)
Y=ones(size(A))
ones(m,n,..classname)
ones([m,n],[classname]..)

8. LineSpace
Generate linearly spaced vectors
Syntax
Y=linespace(a,b)
Y=linespace(a,b,n)

9. EYE
Identity Matrix
Syntax
Y=eye(n)
Y=eye(m,n)
Y=eye(size(A))
eye(m,n,classname)
eye([m,n],classname)

Anda mungkin juga menyukai