Function cirarea - anonymous functions, MATLAB in Engineering

Function cirarea - Anonymous functions:

The function handle name is cirarea. The one argument is passed to the input argument radius. The body of the function is an expression pi * radius .^2. The .^ operator is used so that the vector of radii can be passed to the function.

The function is then called by using the handle and passing the arguments to it. The function call by using function handle appears just like a function call using the function name.

 

 

>> cirarea(4)

ans =

50.2655

>> cirarea(1:4)

ans =

3.1416  12.5664  28.2743  50.2655

Posted Date: 10/20/2012 6:45:48 AM | Location : United States







Related Discussions:- Function cirarea - anonymous functions, Assignment Help, Ask Question on Function cirarea - anonymous functions, Get Answer, Expert's Help, Function cirarea - anonymous functions Discussions

Write discussion on Function cirarea - anonymous functions
Your posts are moderated
Related Questions
Illustration of gauss-jordan: Here's an illustration of performing such substitutions by using MATLAB >> a = [1 3 0; 2 1 3; 4 2 3] a = 1 3 0 2 1 3 4 2

Application: Menu driven Modular Program Numerous longer, more involved programs which have interaction with the user are menu-driven, that means that the program prints a men

Use of Nested if-else statements: By using the nested if-else to select from among the three possibilities, not all the conditions should be tested. In this situation, if x is

. Generate the following signal, x(n)=1+cos((25*pi*n)/100),0 Compute the DTFT of x[n] for w=0:0.01:2*pi Plot the Real part, imaginary part, the amplitude and phas

Plotting from a Function: The following function creates a Figure Window as shown in figure, which shows various types of plots for similar y vector. The vector is passed as a

Algorithm for the function e: The algorithm for the function eoption is as shown: Use the menu function to show the 4 choices. Error-check (an error would take place

1. Write a MATLAB function (upperTriangle) using the functions you previously created to convert a matrix to upper triangular form. Start with row 1, column1. Find the row that has

Illustration of Graphics properties: A particular property can also be exhibited, for illustration, to view the line width:     >> get(hl,'LineWidth')     ans =

Gauss, Gauss-Jordan elimination: For 2 × 2 systems of equations, there are well-defined, easy solution techniques. Though, for the larger systems of equations, finding solutio

Sort algorithm for Sorting vectors of structures: Note that only the price field is compared in the sort algorithm, but the whole structure is replaced. That is therefore each