You are on page 1of 4

URL:1706776

EXPERIMENT NO. -1
AIM: Introduction to MATLAB and computation of basic
mathematical quantities.
MATLAB is a software package for high performance numerical computations and
visualization. IT provides and interactive environment with hundreds of build in
functions for technical computations, graphics and animations. MATLAB stands
for MATrix LABoratry.
MATLAB's built in functions provide excellent tools for linear algebraic
computations and dta analysis, signal processing, optimization, numerical solution
of scientific computations. There are numerous functions for two dimensional and
three dimensional graphics as well as for animations. The basic building block of
MATLAB is matrix. The fundamental data type is array, vector, scalar, real matrix
are all automatically handled as special cases of basic data type. The vectorised
commands or codes run much faster MATLAB
BASIC OF MATLAB
The general structure of MATLAB environment.
MATLAB WINDOWS: On almost all systems MATLAB work through three
basic window.
MATLAB Desktop: This is where the MATLAB puts us when we launch it.
MATLAB desktop by default consists of following sub windows:
Command window: This is the main window. It is characterized by MATLAB
command prompt (>>). All commands including this for running user written
programs are typed in the window at MATLAB prompt in MATLAB7.
Current Directory: This is where all files from the current directory are listed.
We can do file navigation here to see the options. Click the right button of mouse
after selecting a file. We can run M-files, remove them, delete them etc.
Work Space: This sub-window lists all variables that we have generated so far and
shows there types and sizes. We can do various things with phase variables such as
plotting and then using the right button on the mouse to select our option.
Command History: All command typed on MATLAB prompt in the command
window yet recorded, even a cross multiple section in this window. We can select
URL:1706776

a set of commands for this window and create an M- file with right click of mouse.
Figure Window: The output of all graphics, commands typed in the command
window are flushed to the graphics or figure window, a separate gray window with
white background color.
Editor Window: This is where we write, edit, create and save our programs in
files called M-files by using any text editor. However we can use our editor by
typing the standard file editing commands that we normally use on our system.
ONLINE HELP
Online Documentation: MATLAB provides online help for all it’s built in
functions and programming language constructs such as help, look for, helpdesk
and help win.
Demo: MATLAB has a demonstration program that shows many of its features
which includes type demo at MATLAB prompt to invoke demonstration programs
and follow the instructions on the screen.

COMMAND
1. clc- This MATLAB function clears all input and output from the Command
Window display, giving you a clean screen.

2. closeall-This MATLAB function closes all open registered HDF file and
data object identifiers.

3. xlabel-This MATLAB function labels the x-axis of the current axes with the
text specified by str.

4. ylabel-This MATLAB function labels the y-axis of the current axes with the
string, str.

5. zlabel-This MATLAB function labels the z-axis of the current axes with the
string, str.

6. title-This MATLAB function adds the title consisting of a string, str, at the
top and in the center of the current axes.

7. figure-This MATLAB function creates a new figure window using default


URL:1706776

property values.

8. plot-This MATLAB function creates a 2-D line plot of the data in Y versus
the corresponding values in X

9. subplot-This MATLAB function divides the current figure into an m-by-n


grid and creates an axes for a subplot in the position specified by p.

10.bar-This MATLAB function creates a bar graph with one bar for each
element in y.

11.input-This MATLAB function displays the text in prompt and waits for the
user to input a value and press the Return key.

12.zeros-This MATLAB function returns the scalar 0.

13.ones-This MATLAB function returns the scalar 1.

14.exp-This MATLAB function returns the exponential ex for each element in


array X.

15.disp-This MATLAB function displays the value of variable X without


printing the variable name..

16.conv-This MATLAB function returns the convolution of vectors u and v.

17.xcorr-This MATLAB function returns the cross-correlation of two discrete-


time sequences, x and y.

18.abs-This MATLAB function returns the absolute value of each element in


array X.

19.mod-This MATLAB function returns the remainder after division of a by m,


where a is the dividend and m is the divisor.

20.sqrt-This MATLAB function returns the square root of each element of the
array X.

21.min-This MATLAB function returns the smallest elements of A.

22.max-This MATLAB function returns the largest elements of A.


URL:1706776

You might also like