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
Random numbers: Whenever a program is being written to work with a data, and the data is not yet available, it is frequently useful to test the program first by initializing t

how to convert char array to a string cell

Using numerical techniques, plot the intensity distribution for LP 01 and LP 11 modes. Vary the value of V (reduce it to 1.5) and plot several of the intensity plots (of LP 01 )


Illustration of Output statements: For illustration, >> disp('Hello') Hello >> disp(4^3)   64 The formatted output can be printed to the screen by using the fpr

How to Open Simpower: 1. Open MATLAB 2. In the "Command Window" write ' simulink ' and press Enter or click on the Simulink icon. 3. Simulink Library Browser w

Write a matlab function that calls eig and generates an estimate of the smallest three eigenvalues and associated eigenfunctions of the negative Laplacian operator on ?. (Hint: thi

Micro-mouse is an engineering design competition created by IEEE in the late 1970s. Small robotic "mice" solve a 16x16 cell maze. The mice are completely autonomous and must find t

how can i used loops instead of polyfit function

my project is on load frequency control using FPID tuned using GA and PSO algorithm.the system is a two area system.