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
Read in any non jpeg image (any image will do) . Save it as a jpeg at quality levels (70, 60,50,40, 30) Get the MSE for each quality level as compared to the orignal file Get the

Mathematical operation: For numerical operands, the use of such operators is clear-cut. For illustration, 3 >> 3 ans = 1 >> 9 ans = 0 Though, in the Wo

Hi, I need help with solving five-1st order ODE which are coupled. I need to plot these as well. Could I please get a quote. Thanks

what are data collect this topic,how i can create algorithm in mat lab what language support easy to this topic

Error-Checking user input in the While Loop: In many applications, whenever the user is prompted to enter anything, there is a valid range of values. When the user enters a wr

You are a quant analyst reporting directly to a portfolio manager. Your manager requires you to generate a simple code to compute several statistics for the following potential por


Example: Load from File and Plot Data: As illustration, a file known as timetemp.dat stores two lines of data. The first line is the time of the day, and the next line is the

matlab code for path and adjancy martix between pixels

People arrive at a microscope exhibit at a rate of one every 8+/- 2 minutes. Only one person can see the exhibit at a time. It takes 5 +/- 2 minutes to see the exhibit. A person