Linspace function, MATLAB Programming

Linspace function:

Likewise, the linspace function generates a linearly spaced vector; linspace(x,y,n) generates a vector with n values in the inclusive range from x to y. For illustration, the following generates a vector with 5 values linearly spaced between 3 and 15, involving the 3 and 15:

>> ls = linspace(3,15,5)

ls =

3   6   9   12   15

The Vector variables can also be generated using existing variables. For illustration, a new vector is generated here consisting first of all the values from nv followed by all values from ls:

>> newvec = [nv ls]

newvec =

1   3   5   7   9   3   6   9   12   15

Place two vectors altogether like this to generate a new one is termed as concatenating the vectors.

 

 

Posted Date: 10/18/2012 4:14:41 AM | Location : United States







Related Discussions:- Linspace function, Assignment Help, Ask Question on Linspace function, Get Answer, Expert's Help, Linspace function Discussions

Write discussion on Linspace function
Your posts are moderated
Related Questions
Algorithms: Before writing any computer program, it is very useful to first outline the steps which will be essential. An algorithm is the series of steps required to solve a

Use Matlab to solve the following set of linear equations by Gaussian Elimination. Write a for loop to perform elementary row operations on the augmented matrix to produce

Your functions will allow you to create the following graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and t


Adaptive filters can also be used in other applications. Speech recognition, for example, is performed in a non-stationary environment, and therefore may require adaptive filtering

Random numbers: Whenever a program is being written to work with a data, and the data is not yet available, it is frequently useful to test the program first by initializing t

Show the output - algorithms: Where does the output go? The two possibilities are (i) to an external file, or (ii) to a window on the screen. Based on system, one of these wil

Simple Related Plot Functions: The other functions which are useful in customizing plots are the figure, clf, hold, leg-end, and grid. The short description of such functions

Q. Explain Power system toolbox ? Power system toolbox (PST) was developed to enable users to perform power system analysis within MATLAB. PST may be used on any computer syste

Matlab Programming Vector Algebra : Create a program package for calculation of distances and intersections of lines and planes. Plot the results in a graphical representation