Thursday, September 10, 2020

procedure to create an array using linspace function

 procedure to create an array using linspace function


 

 

procedure to create an array using linspace function

=======================================================================

 

The linspace() function is used to create an array with

evenly spaced points between a starting point and

ending point .The expression of linspace() function is as

given below :

 

linspace(start,stop,n)

 

Here , 'start' represents the starting point .

'stop' represents the ending point.

'n' is an integer that represents the number of parts the

element should be divided . If 'n' is omitted , then n is

taken as 50.

 

Example

a = linspace(0,10,5)

 

In the above statement , an array is being created with

starting point element 0 and ending point element as

10 . This range is divided into 5 equal parts and hence

the points are 0 , 2, 5, 7.5 and 10 , and all these subdivided

elements within the range are stored into 'a' array .

Here , the starting and the ending point elements

are part of the array and not omitted from the array .

 

 

 

 

No comments:

Post a Comment

Durga Puja in Odisha

 Durga Puja in Odisha