Experiment 3 - ECE103 Experiment#3 Experiment#3 Student...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE103 Experiment #3 Student name(s): Page 1 of 7 02/05/08 Experiment #3 Basic use of MATLAB ® Objective: In this lab you will be introduced to basic use of MATLAB We will introduce the very basic concepts using a powerful software package called MATLAB. This is a high performance language that integrates computation, visualization and programming. MATLAB stands for matrix laboratory. The program easily handles matrixes and vectors and has a powerful graphic package to display magnitudes in 2 and 3 dimensions. MATLAB language is specially oriented to calculations with vectors and matrixes. To perform calculations with these elements is straightforward. Let us go with an example. When you run the program a command window will appear. It is possible to customize the arrangement of the desktop, and arrangement shown in the figure is one possibility. The right side window is the “command” window and this is the place where we will write the instructions. The left side window will keep track of all defined variables and its dimensions. As mentioned before, MATLAB operations are designed to work with matrixes. Special cases are 1x1 matrixes (scalars) or matrixes with only one row or column (vectors). For example the instruction 5*3 MATLAB will give us ans = 15 The variable “ans” stores the result of the last calculation. It will be overwrite in the next calculation. If we want to store a variable a permanent way we can define a variable x=5*3
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
ECE103 Experiment #3 Student name(s): Page 2 of 7 02/05/08 Notice that MATLAB is case sensitive (this is x and X are two different variables). One convenient way to work with MATLAB is using the editor window. The editor window allows writing a sequence of instructions that MATLAB will execute in a text file with extension .M. This is particularly useful when programming. Matrixes To enter a matrix simply type in the command window the matrix elements separated by spaces, and each row separated by “;”. For example we can enter a row vector with the following command a=[1 2 3 4 5 6 7 8 9] and a column vector with b=[1;2;3;4;5;6;7;8;9] In the left side window it will be listed these two variables with the respective assigned values, a is a matrix with 1 row, and 9 columns; b is a matrix with 1 column and 9 rows.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 7

Experiment 3 - ECE103 Experiment#3 Experiment#3 Student...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online