Illustration of a built-in function, MATLAB Programming

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

Posted Date: 10/18/2012 7:12:55 AM | Location : United States







Related Discussions:- Illustration of a built-in function, Assignment Help, Ask Question on Illustration of a built-in function, Get Answer, Expert's Help, Illustration of a built-in function Discussions

Write discussion on Illustration of a built-in function
Your posts are moderated
Related Questions
cAN Can I learn Metlab .I am X Scientist in DigitalCommunication. Can U please help me.I know the programming concepts

This can be done from the command line or from a makefile. You require a script (filename.m). Just type at the command line, or contain in the makefile: matlab


Find the boundary between each two of the equations P1, P2, P3 by solving: P1 = P2  ,  P1 = P3  ,  P2 = P3 Plot the boundary lines on a single figure that also includes the

An individual with $10,000 to invest has identi?ed three mutual funds as attractive opportunities. Over the last ?ve years, dividend payments (in cents per dollar invested) have be

Using numerical techniques, plot the intensity distribution for LP 01 and LP 11 modes. Vary the value of V (reduce it to 1.5) and plot several of the intensity plots (of LP 01 )

Compare results/performance with tridiagonal Gaussian elimination solver for the problem arising from -y''=f   on (0,1) with y(0)=0=y(1). You may also need to use sparse storage an

Function char: The function char does the opposite; it converts from any number type to the type char: >> char(numequiv) ans = a As the letters of the alphabet are

Write a function called threshold2 (in a file called 'threshold2.m'). The function takes an arbitrary number of input variables. The first input variable, t, is required and is the

a) Develop and submit a power-based MC "SNR" simulator (derived from the voltage-based SNR program provided in MS Powerpoint file) that: i) Uses the following Input: Time period