Prev: how can I do integer optimization with GA in Matlab?
Next: superimposing plots obtained using imfreehand
From: Learn By on 27 May 2010 14:30 http://learnbyexamples.org Matlab Tutorial 1 – The basic features et 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. http://learnbyexamples.org/matlab/matlab-tutorial-1-the-basic-features.html |