illustration of a built-in functionthe length


Illustration of a built-in function:

The length function is an illustration of a built-in function which computes a single value; it returns the length of a vector. As an illustration, length (vec) is an expression; it shows the number of elements in the vector vec. This expression can be used in the Command Window or in a script. Usually, the value returned from this expression may be assigned to the variable:

>> vec = 1:3:10;

>> lv = length(vec)

lv =

4

Alternatively, the length of vector could be printed

>> fprintf('The length of the vector is %d\n', length(vec))

The length of the vector is 4

Request for Solution File

Ask an Expert for Answer!!
Applications of MATLAB: illustration of a built-in functionthe length
Reference No:- TGS0174784

Expected delivery within 24 Hours