Illustration of variable number of input arguments, MATLAB Programming

Illustration of Variable number of input arguments:

In this situation, it was supposed that the radius will always be passed to the function. The function header can hence be modified to specify that the radius will be passed, and then a variable number of the remaining input arguments (either no one or one):

640_Illustration of Variable number of input arguments.png

>> areafori2(1,'i')

ans =

  452.3893

>> areafori2(3)

ans =

  28.2743

Note that the nargin returns total number of input arguments, not merely the number of the arguments in cell array varargin.

 

Posted Date: 10/22/2012 1:17:55 AM | Location : United States







Related Discussions:- Illustration of variable number of input arguments, Assignment Help, Ask Question on Illustration of variable number of input arguments, Get Answer, Expert's Help, Illustration of variable number of input arguments Discussions

Write discussion on Illustration of variable number of input arguments
Your posts are moderated
Related Questions
The Colon Operator: If the values in the vector are regularly spaced, the colon operator is used to iterate through these values. For illustration, 1:5 results in all the inte


In MATLAB, create a correlation matrix for all of the variables in the data (it should be an 8x8 matrix). To do this you will have to convert the "southern"variable into a number.

MRI (magnetic resonance imaging) scanners allow doctors to now obtain complete body images for medical diagnosis purposes. The system produces scans which represent slices through

please tell me how to compress a video in matlab

what are the difference between a.linear permutation b.circular permutation

The occurrence of bushfires in the Port Stephens area may be modelled by a Poisson process. The average occurrences of bushfires n is assumed to be either 15 (event A 1 ), 20 (even

The circuit diagram of an active filter is shown below. (a) Determine an expression for the transfer function of the filter. (b) Hence find an expression for the frequency res