Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Matlab basic Tutorial
Replies: 3   Last Post: May 27, 2010 2:23 PM

 Messages: [ Previous | Next ]
 Elite Hussar Posts: 7 From: USA Registered: 5/24/10
Matlab basic Tutorial
Posted: May 27, 2010 5:14 AM

Matlab Tutorial 1- The basic features
Let us start with something simple, like defining a row vector with components the numbers 1,2,3,4,5 and assigning it a variable name, say x

<< x=[1 2 3 4 5]

x =

1 2 3 4 5

Note that we used the equal sign for assigning the variable name x to the vector, brackets to enclose its entries and spaces to separate them. (Just like you would using the linear algebra notation). We could have used commas ( , ) instead of spaces to separate the entries, or even a combination of the two. The use of either spaces or commas is essential!
To create a column vector (MATLAB distinguishes between row and column vectors, as it should) we can either use semicolons ( ; ) to separate the entries, or first define a row vector and take its transpose to obtain a column vector. Let us demonstrate this by defining a column vector y with entries 6, 7, 8, 9, 10 using both techniques.