Vous êtes sur la page 1sur 3

Characteristics of the MATLAB Environment

MATLAB
originally developed to be a Matrix Laboratory interactive system and programming language for scientific and technical computation writing computer solutions in MATLAB is much quicker than using a high-level language

MATLAB Windows

Prompt

To begin, select the MATLAB program from a menu in your operating system or just click MATLAB icon with mouse. To exit, use quit or exit.

Display windows

Command window: used to enter commands and data and to print results Graphic window: used to display plots and graphs Edit window: used to create and modify M-files, which are files that contain a program or script of MATLAB commands
MATLAB Expo

To see some of the capabilities of MATLAB, enter the demo command. This initiates the MATLAB Expo, a graphical demonstration environment that illustrates some of the different types of operations. To get help menu, simply enter the help command.

INITIALIZING MATRICES
Explicit Lists A = [2.7]; B = [1, 2.7]; C = [-2, 0, 3; 1, 1, 9.2; 0, 0, 2]; or [-2 0 3;1 1 9.2; 0 0 2]; D = [1 2 3 4]; B = [1 2]; S = [3 B] (= [3 1 2]) S(2) = 5 changes the second value in the matrix S from 1 to 5 S(4) = 7.2 makes matrix S having four values instead of three S(7) = -2 , then the matrix S will have seven values, and the values of S(5) and S(6) are automatically set to zero Note: The who command list the matrices that you have defined, and the whos command list the matrices and their sizes. Colon Operator A = [-1 0 0;1 1 2; 0 0 2]; x = A(:, 1); the vector x will contains the 1st column of the matrix A h = 1:8; will generates a vector h that contains the numbers from 1 to 8 time = 0.0:0.5:5.0; values = 10:-1:0; C= C_partial_1 = C(:, 2:3) = 1 0 0 0 0 1 1 0 1 0 1 1 0 1 0 0 2 0 0 2 A means the transpose of A x = 0:4; y = 5:5:25; [x y] = 0 5 1 10 2 15 3 20 4 25

Special Values and Special Matrices pi i, j represents represents 1

Inf represents infinity zeros; ones; eye; size etc. A = zeros(3); B = zeros(3,2); C = [1 2 3;4 2 5]; D = zeros(size(C)); 0 0 0 A = 0 0 0 0 0 0 0 0 B = 0 0 0 0 1 2 3 C= 4 2 5 0 0 0 D= 0 0 0

User Input z = input(Enter values for z in brackets: );

Vous aimerez peut-être aussi