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
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

Matlab Command Reference 1. Getting Help: The help command is used to find the functions and its syntax. Similarly, lookfor is used to find the functions or topics. For examp

How to design a FIR filter using ANFIS in MATLAB

Given , provide solutions for the following systems of equations a) , 1.0 10.5 0.5 9 0.5 3.25 5.25 2.5 2 13 5 6 ? ? ? ? ? ? ? ? ? ? ? A ? ? ? ? ? ? ? ? ? ? ? ? 3 7 16 b b) , 1.0 10

I have a biological signal need to be shifted by 12.5 ms and then add all the shefted signals together

The diagram shown on the next page represents a planar pantograph-based leg for a walking robot. This model utilizes only one DOF to generate the walking gait at the foot link 'n

Illustration of a conditional loop - While loop: As an illustration of a conditional loop, we will write a function which will find the first factorial which is greater than 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

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