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

Illustration of Output statements: For illustration, >> disp('Hello') Hello >> disp(4^3)   64 The formatted output can be printed to the screen by using the fpr

How to make EMG analysis by Matlab?

how to implement visual cryptography on grayscale images

Non-Ideal Gas (van der Waals equation):  An equation of state for a non-ideal which is commonly used is the van der Waals equation for 1 mol of gas  P = (R*T)/(V-b) - a/(V^2)

how to find absolute value of a number

A band pass FIR filter is required to pass frequencies from 5KHz to 8KHz, using a sample rate of 40K i) Explain how this would map to normalization sampling frequencies in radia

Write a script to determine the volume of a pyramid, which is 1/3 * base * height, where the base is length * width. On time the user to enter values for the length, width, and th

drow midpoint circle for scan converting acircle in matlab

Illustration of Input function: For illustration, >> rad = input('Enter the radius: ') Enter the radius: 5 rad = 5 If character or string input is preferred, 's' s