Sunteți pe pagina 1din 11

61

MATLAB ENVIRONMENT

MATLAB is a very powerful tool in scientific and engineering computing. It


possesses various computational and engineering functions which would aid
students, scientists and engineers to discover, develop and formulate theories,

concepts in a wide range of applications.


OBJECTIVES
This chapter aims introduce MATLAB software and its different interfaces.
At the end of this lesson, the students should be able to:
1. Explore the MATLAB environment.
2. Differentiate the various windows of the MATLAB, its purpose and its
application.
3. Perform basic mathematical operations in MATLAB.
DISCUSSION

MATLAB is a high-performance language for technical computing. MATLAB


is an interactive system whose basic data element is an array that does not

require dimensioning. This allows you to solve many technical computing


problems, especially those with matrix and vector formulations, in a fraction of
the time it would take to write a program in a scalar non-interactive language
such as C or Fortran. It integrates computation, visualization, and programming
in an easy-to-use environment where problems and solutions are expressed in
familiar mathematical notation. MATLAB is a useful tool in mathematics and
computation, algorithm development, data acquisition, modeling, simulation,
and prototyping. It can also be used in various engineering applications such as
data analysis, exploration, and visualization, scientific and engineering graphics,
application development, including graphical user interface building.

This is a high-level matrix/array language with control flow 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. MATLAB has extensive facilities for

displaying vectors and matrices as graphs, as well as annotating and printing


these graphs. It includes high-level functions for two-dimensional and threedimensional data visualization, image processing, animation, and presentation
graphics. It also includes low-level functions that allow you to fully customize the
appearance of graphics as well as to build complete graphical user interfaces
on your MATLAB applications.

SYSTEM REQUIREMENTS
On Windows platforms, MATLAB requires: Windows XP Service Pack 3 or
later, a processor from Intel of AMD x86 supporting SSE2 instruction set, at least
1GB for MATLAB only and at least 1024 MB of memory.

STARTING MATLAB
On Windows platforms, to start MATLAB, double-click the MATLAB shortcut

icon

on your Windows desktop. Another way of starting up MATLAB is

by looking for the MATLB applications under All Programs of the Windows button.

QUITTING MATLAB
To Close MATLAB application, one can do any of the following:
1. Choose Exit from the File menu

2. Click x from the upper right corner of MATLAB interface


3. Press Alt+F4 and confirm

DEVELOPMENT ENVIRONMENT
This is the set of tools and facilities that help you use MATLAB functions and files.
Many of these tools are graphical user interfaces.

It includes the MATLAB

Desktop and Command Window, a Command History, an Editor and debugger,


and browsers for viewing help, the workspace, files, and the search path.
Mathematical Function Library
This is a vast collection of computational algorithms ranging from elementary
functions like sum, sine, cosine, and complex arithmetic, to more sophisticated
functions like matrix inverse, matrix eigenvalues, Bessel functions, and fast Fourier
transforms.

The MATLAB Desktop

The MATLAB desktop contains the general interface of MATLAB.

It is further

subdivided into different windows: The Command Window, The Workspace and
the Command History
The Command Window

The Command Window is used to run commands or built-in MATLAB functions


and user defined m-files.
The Command History

Commands executed in the command window are logged in the Command


History. One can easily redo commands saved in the Command History by
double clicking the selected commands.

The MATLAB Start Button

The MATLAB Start Button provides easy access to tools, demos, and

documentations.
The Current Directory

The Current directory is where MATLAB accesses the m-files prepared by the user
and where current works would be saved.

The Array Editor

The Array editor appears when a certain variable in the Workspace is selected
and the values of this variable can be changed.

The Help Navigator

The Help Browser is used to search and view documentation associated with
each MATLAB built-in commands and functions and demos for some MathWorks

products. The Help Browser is a Web Browser integrated into MATLAB desktop
that displays HTML documents.
The Editor/Debugger

The Editor Window is a pop-up window where the programmer can type
MATLAB scripts and functions. It has the option to debug, simulate and run the
program.

Activity 1.1

MATLAB Environment

TOPIC
OBJECTIVES

1. Explore the MATLAB environment.


2. Differentiate the various windows of the MATLAB, its purpose
and its application.
3. Perform basic mathematical operations in MATLAB.

NAME
ACCT #

TERMINAL#

COURSE /SEC

PROG / YEAR

ROOM

SCHEDULE

FACULTY
INSTRUCTIONS Answer the following items on the space provided.
1. On the command window, write down the what would appear in the
command window upon typing commands:
A >>help tand

B :>> help cos

C :>> help asin

D :>> lookfor exponential

2. Follow the following steps and answer the succeeding questions:


On the command window type:
>> A = 3, 5, 8, 10 ; 9, 7, 9, 8
>> B = A .* A;
>> C = B* A
Find the values of A, B and C

List down the properties of the variables A, B and C as seen on the Workspace:
A:
B:
C:
3. In verifying the formula for the infinite progression:
a
S 0
1 r
For the geometric progression with the first term a0 = 8 and common ratio r = 1/3.
Narrate on the right side of the program what is being done
Command Line
Result
Narration
>> S = 8
>> S = 8 +1/3*S
Double Click the Last
the Command History
Double Click the Last
the Command History
Double Click the Last
the Command History
Double Click the Last
the Command History
Double Click the Last
the Command History
Double Click the Last
the Command History
Double Click the Last
the Command History
Double Click the Last
the Command History
Double Click the Last
the Command History
Double Click the Last
the Command History
Double Click the Last
the Command History
Double Click the Last
the Command History
Double Click the Last
the Command History
Double Click the Last
the Command History
Double Click the Last
the Command History

Command in
Command in
Command in
Command in
Command in
Command in
Command in
Command in
Command in
Command in
Command in
Command in
Command in
Command in
Command in

>> SUM = 8 / (1 1 / 3)

S-ar putea să vă placă și