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

Consider the shaft-rotor system shown in Figure. Write down the equations of motion. Taking  I= 1 kgm 2 and k=10 kNm/rad, for two special cases (α =0.5 and α = 1000) find as many

Creating matrix variables- arguments: The CAT arguments dimensions are not reliable. The Iterators can also be used for the values on the rows by using the colon operator;

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

Calling a Function: Here is an illustration of the call to this function in which value returned is stored in the default variable ans: >> calcarea(4) ans = 50.2655

Script - MATLAB: The script is a series of MATLAB instructions which is stored in a file and saved. The contents of a script can be showed in the Command Window by using the t


In this lab, we study the three concepts. Vector is used to store more than one value into single variable. It is similar to array (other programming language). Script is a collect

Variable number of input arguments: For illustration, the below function areafori has a variable number of input arguments, either the 1 or 2. The name of the function stands