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
Command Window: To the left of the Command Window, there are 2 tabs for the Current Directory Window and Workspace Window. If the Current Directory tab is selected, the files

Create a GUI that has A button to bring up a dialog to select a text file and read it in. Plot the x,y values on the GUI Have text entry values, one for each parameter, in which

Illustration of script: For illustration, we will now generate a script known as script1.m which calculates area of the circle. It assigns a value for the radius, and then com

I want to write a function in matlab which gives me a population pyramid bar chart. could you please help me do this.

Build a single phase model for the simple 3-phase system shown in the single line diagram shown below using SimPowerSystems in MATLAB Simulink. Data: Source Voltage

I want to write a function in matlab which gives me a population pyramid bar chart. could you please help me do this.

To accept two numbers from the user; Display all prime numbers between these two numbers.

A file houseafford.dat stores on its three lines years, median incomes and median home prices for a city. The dollar amounts are in thousands. For example, it might look like this:

coding of sep protocol

Compute the result: To compute the area, the formula is required. In this situation, the area of the circle is π multiplied by the radius squared. Therefore, that means the va