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
The Format Function and ellipsis: The default in MATLAB is to show numbers which have decimal places with four decimal places. The format command can be used to identify the o

convolve the following sequences using tabulation method and verify the same using matrix mmethhod

Ant Colony Optimization for Optimization of Route path taken Ant Colony Algorithm is a potential candidate for coupled, 3D optimisation. Ant Colony Algorithm enjoys the overall

From A to B the inlet valve is open and the steam pressure increases linearly from 0.1000 MPa absolute to 15.00 MPa absolute, 1000°C. The inlet valve closes and from B to C the

The following four 4 equations are needed to be plotted as CONTOUR lines on the axes space (C, T) where C is the horizontal axis, and T is the vertical axis. Contour lines for

Example of variable names: If nothing appears when, who or whose is entered, which means there aren't any variables! For illustration, in the starting of a MATLAB session, the

Type logical: The type logical is used to store the true/false values. If any variables have been formed in the Command Window, they can be seen at the Workspace Window. In

Obtain the input - Algorithms: From where does the input come? The two possible choices would be from an external file on a disk, or from the user, who enters the number by ty

Hold and legend function: hold: is a toggle which freezes the present graph in the figure window, so that the new plots will be superimposed on the present one. Just hold

The characteristic properties of an aquifer can be used to calculate groundwater velocities, v groundwater (L/T), according to: where KH (L/T) is the hydraulic conductivit