Vous êtes sur la page 1sur 4

MATLAB

INTRODUCTION MATLAB is a software package for high performance numerical computation and visualization. It provides an interactive environment with hundreds of built in functions for technical computation graphic animation. It also provides easy extensibility with its own high level programming language. The name MATLAB stands for MATRIX LABORATORY. MATLAB built-in functions provide excellent tools for linear algebra computations, data analysis, signal processing optimization, numerical solution of ordinary differential equations, quadrature and many other types of scientific computations. There are numerous 2D and 3D graphics as well for animation. MATLAB even provides external surface to run programs like FORTRAN and C codes from within MATLAB. In addition to built in functions, user can write his own functions which behaves just like builtin functions. There are several optional tool boxes which are collections of functions written for special applications such as symbolic computations, image processing, statistics control design, neural networks etc The basic building of MATLAB is matrix. The fundamental data type is the array. Vectors, scalars, real matrices and complex matrices are automatically handled as special cases of basic data type. BASICS OF MATLAB MATLAB WINDOWS On all systems MATLAB works through three basic windows. 1.COMMAND WINDOWS This is the main window. It is characterized by the MATLAB command prompt>>. When you launch the application program MATLAB put u in this windows. All commands, including those for running user-written program are typed in the window at the MATLAB prompt. 2.GRAPHICS WINDOW The output of all graphics command typed in command Window are flushed to graphics or Figure window, a separate grey window with (default) white background colour. The user can create as many figure windows as the system memory will allow. 3. EDIT WINDOW This is used where you write create and save your own programs in files called M-files. You can use any text editor to carry out these tasks. On most systems

MATLAB provides its own in-built editor. You can use your own editor by typing the standard file editing command that you normally use on your system. ON-LINE HELP ON-LINE DOCUMENTATION: MATLAB provides on-line help for all its built-in functions and programming language constructs. The commands look for, help, helping and helpdesk provide on-line help. DEMO: MATLAB has demonstration program that shows many of its features. The program includes a tutorial introduction that is worth trying. Type demo of MATLAB prompt to invoke the demonstration program and follow the instruction on the screen. INPUT-OUTPUT MATLAB supports interactive computation taking the input from the screen and flushing the output to the screen. In addition it can read input files and write output files. Following features hold for all forms of input and output. DATA TYPE The fundamental data type in MATLAB is the array. It encompasses several distinct data objects like integers, doubles, matrices, character strings, structures and all. No need to declare data objects. MATLAB automatically sets the variable as it is. DIMENSIONING Dimensioning is automatic in MATLAB. No dimension statements are required for vectors or arrays. CASE SENSTIVITY MATLAB is case sensitive. Most MATLAB commands and built-in function calls are typed in lower case letters. OUTPUT DISPLAY The output of every command is displayed on the screen unless MATLAB is directed otherwise. A semicolon at the end of a command suppresses the screen output, except for graphics and on-line help commands. COMMAND HISTORY MATLAB saves previously typed commands in a buffer. This command can be recalled with the up arrow key. This helps in editing previous commands. FILE TYPES MATLAB has three types of files for storing information.

M-FILES These are ASCII text files with an .m extension to the filename. There are two types of these files: script files and function files. Most programs you write in MATLAB are saved in M-Files. All built-in fuvctions in MATLAB are M-Files. MAT FILES These are binary data files with a .mat extension to the filename. Mat-Files are created by MATLAB when you save data with the save command. The data is written in a special format that only MATLAB can read. MEX FILES These are MATLAB callable FOTRAN and C programs with a .mex extension to the filename.

GENERAL COMMANDS
ON-LINE HELP help:lists topics on which help is available. Helpwin:opens the interactive help window. Helpdesk:opens the web browser band help facility. help topic:provides help on topic look for string:-lists help topics containing string. demo:runs the program demo. WORKSPACE INFORMATION clear:Clears the workspace, all variables are removed. clear x y z:Clears only variables x, y and z clear all:Clears all variables and functions from workspace. clc:Clears command window, command history is lost. clf:Clears figure window. DIRECTORY INFIORMATON pwd:Shows the current working directory. cd:Changes the current working directory. dir:Lists contents of the directory. copy file:Copies a file. mkdir:Creates a directory. GENERAL INFORMATION clock:- Tells you wall clock time and date as a vector. date:Tells you date as a string. computer:Tells you the computer type you are using. TERMINATION quit:Quits MATLAB. exit:Quits MATLAB.

Vous aimerez peut-être aussi