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
IS Functions for Strings: There are many functions for strings, that return logical true or false. The function isletter returns the logical true when the character is a lette

Reading from a File in a While Loop: Though in most languages the combination of a loop and an if statement would be essential to determine whether or not the elements in a ve

Algorithm for appex subfunction: The algorithm for appex subfunction is as shown:  Receives x & n as the input arguments.  Initializes a variable for running sum of t

Write a program to examine exponential function: We will write a program to examine the value of e and the exponential function. It will be a menu-driven. The menu options wil

Illustration of finding a sting: Let's enlarge this, and write a script which creates a vector of strings which are phrases. The outcome is not suppressed so that the string

analyzing traffic; determine motion of flow; calculate tracklets; detect abnormalities;

Subfunctions: Though, it is possible to have more than one function in a given M-file. For illustration, if one function calls the other, the first function would be the prima

Appending variables to the Mat-File: Appending to the file adds to what has been saved in a file, and is accomplished by using the -append option. For illustration, supposing

How can I use the weighted moving average formula in matlab to smooth a column data of 404 values?

True color matrice: The true color matrices are the other way to represent images. The true color matrices are 3-dimensional matrices. The first two coordinates are the coordi