Cell array varargin and cell array varargout

Assignment Help Other Subject
Reference no: EM13291641

Write a function that accepts a variable number of input parameters using the cell array varargin, and outputs a variable number of arguments using the cell array varargout. Your function should examine each input argument in varargin to make sure it is numeric. If it is not numeric it should be ignored. If it is numeric, it should be added to a running total and each element counted. Your function should return three items: the count of numbers passed in to the function, the sum of the numbers, and the average of the numbers. Note: the numeric arguments passed in may be arrays, in which case you will need to deal with each of the numeric entries individually.

To test your function, you should write a test program that calls your program. If you call your program with the following data, your answers should be as shown below:

Data: a=5; b=[1 2 3 4; 5 6 7 8; 9 10 11 12]; c=[1 2 3];

Result: Count = 16, Sum = 89, Average = 5.5625

Be sure to handle the case where the function is called with more output arguments than what your function is designed to handle. Your test program should try calling your function with one, two, three and four output arguments. We won’t pass in any arrays with more than two dimensions, but you will need to be careful when summing the numbers in an array.

Reference no: EM13291641

Questions Cloud

What is the holding period return for the year : The value of the portfolio on December 31 of the same year was $113,201. At the end of June, Stacy withdrew $5,000 from the portfolio. What is the holding period return for the year?
Origins of transnational organized crime : Which of the following was not an important factor in the origins of transnational organized crime?
Calculate the total distance traveled : A train accelerates at 1.93 m/s2 from rest to a steady speed in 72.61. It maintains that speed for 20.25 miles, What is the total distance traveled
How much power is dissipated at half the maximum voltage : What is the safe operating voltage for a 100 Ohm, 1/10W resistor, How much power is dissipated at half the maximum voltage
Cell array varargin and cell array varargout : Write a function that accepts a variable number of input parameters using the cell array varargin, and outputs a variable number of arguments using the cell array varargout. Your function should examine each input argument in varargin to make sure it..
Does this violates the uncertainty principle : In the Bohr model, the electron in H has a circular orbit. For an isolated atom, the only force on the electron is the strictly radial electrical force. Does this violates the uncertainty principle
What is the amount of income juan must declare : No funds were contributed or withdrawn during the year. What is the amount of income Juan must declare this year for income tax purposes?
How much time is required for projectile to come up to speed : Scientists are experimenting with a kind of gun that may eventually be used to fire payloads directly into orbit. How much time is required for the projectile to come up to speed
What is the macaulay duration : A $1,000, 7% annual coupon bond matures in three years. The bond is currently priced at $974.23 and has a YTM of 8.0%. What is the Macaulay duration?

Reviews

Write a Review

Other Subject Questions & Answers

  What event brought mcculloch v. maryland

What event brought mcculloch v. maryland before the supreme court

  Delivery of personal health care services

Should the role of government move more toward assuring quality and a minimal standard of care rather than the delivery of personal health care services?

  Availability of substitutes-consumer’s time horizon

Provide an example for each of the three determinants in the previous question (Availability of substitutes, Share of consumer income devoted to a good, and Consumer’s time horizon).

  Three-store memory theory

Can someone help me to understand the three-store memory theory and levels of processing memory theory.

  Organizational theory and growth

Describe the process of organizational development and the significance of organizational change to Hal.

  Observed agreement between the test and the result

A psychologist has developed a test for school children that is supposed to identify who will commit violent crimes during adolescence and young adulthood. In one school 10 percent of the 200 children tested show a positive result, indicating crimina..

  Description and reflection of debt

In the beginning of class, we started talking about debt. The word debt is a monetary idea that gets along with money. Along with Graeber, debt is a state of money that is owed to a bank.

  Dual labor market-environmental justice issues-redlining

Define all of the following terms and explain whether or not your ethnic group was affected by any of the these forms of discrimination? Provide examples. Refer to the text for the definitions.

  Did not believe that humans should strive for righteousness

____did not believe that humans should strive for righteousness or that God blesses pious people; rather, The Elohim (Mighty Powers) determined a very long time ago everything that ever happens, including whether or not anyone will earn their own liv..

  Monozygotic twin studies

What are monozygotic twin studies? Why are the findings of these studies significant in the process determining whether specific mental health disorders have genetic etiologies?

  Drug control policy strategies presented

Presentation on the advantages and disadvantages of the three drug control policy strategies presented during the open hearing in the scenario

  What was effect of editing the email to stick to the facts

From Van den Bosch's point of view, what was his intention in sending the email and what was the effect of editing the email to "stick to the facts"?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd