Read the given MATLAB codes, answer the following three questions: cle clear % get n n...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Read the given MATLAB codes, answer the following three questions: cle clear % get n n = input('enter n: "); if n <0 disp(error--n must be non-negative!"); elseif round(n)-n else end disp("error--n must be an integer!'); if n ==0 fact=1; else fact=1; for i=1:n end fact fact*ii; end disp([int2str(n), "!=, int2str(fact)]); (1) if n =-4, write down the output. (2) if n = 0.4, write down the output. (3) if n = 4, write down the output. Read the given MATLAB codes, answer the following three questions: cle clear % get n n = input('enter n: "); if n <0 disp(error--n must be non-negative!"); elseif round(n)-n else end disp("error--n must be an integer!'); if n ==0 fact=1; else fact=1; for i=1:n end fact fact*ii; end disp([int2str(n), "!=, int2str(fact)]); (1) if n =-4, write down the output. (2) if n = 0.4, write down the output. (3) if n = 4, write down the output.
Expert Answer:
Answer rating: 100% (QA)
matlab clc clear get n n inputenter n if n 0 disperrorn must be nonnegative elseif roundn n disperro... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
AirQual Test Corporation provides on-site air quality testing services. The company has provided the following cost formulas and actual results for the month of February: Fixed Component per Month...
-
In the event of a dispute over earnest money, the contract to buy and sell real estate states that the broker
-
The new line character is utilized solely as the last person in each message. On association with the server, a client can possibly (I) question the situation with a client by sending the client's...
-
Has Mississippi enacted the Uniform Real Property Electronic Recording Act? Provide the URL/web address of your source. Provide the citation to where this law is found in the Miss. Code (including...
-
Given the stream section shown in Fig and the following measurements, calculate the total discharge throughout the section (Table). Sration 112 1615 &D 06p Measurement Station Distance Across Stream...
-
The truss is made from five members, each having a length L and a mass density . If the mass of the gusset plates at the joints and the thickness of the members can be neglected, determine the...
-
Payroll computation with incentive bonus Fifteen workers are assigned to a group project. The production stan- dard calls for 500 units to be completed each hour to meet a customer's set deadline for...
-
As part of the engagement team for the audit of JA Tire Manufacturing for the year ended December 31, 2019, you are responsible for auditing the sales and collection cycle. If you have not done so...
-
Pena Company is considering an investment of $ 2 7 , 1 6 0 that provides net cash flows of $ 8 , 2 0 0 annually for four years. ( a ) If Pena Company requires a 7 % return on its investments, what is...
-
Illini leases another piece of equipment from Cubs Corporation under a four-year lease agreement on 1/1/20x1. The lease specifies annual payments on each 1/1 and the first payment of $10,000 is made...
-
Kilmer Company has demand for its only product that exceeds its manufacturing capacity. The company provided the following information for the machine whose limited capacity is prohibiting the...
-
At Peterson State High School, exam results in both Economics and Legal Studies are known to be normally distributed. The mean Economics exam result is 73 marks and the standard deviation is 8 marks....
-
A rigid container of 0.2 kg R-134a at a quality of 0.4 is heated such that the temperature increases by 111.65 F. The container is originally at a pressure of 500 kPa. Note: you can use interpolation...
-
I need two sensitivity analyses completed based on the following data. The two sensitivity analyses text should include any assumptions and limitations, a description of the methodology used to...
-
14. A straight bevel gear pair has the following data: NP=15; NG=45; Pd=6; and 20 pressure angle. If the gear pair is transmitting 3.0 hp, compute the forces on both the pinion and the gear. The...
-
State Bank of India has offered a spot rate quote on Indian rupees (Rs.) of Rs. 42.47/$. The Indian rupee is quoted at a 30-day forward discount of 7.65 percent against the dollar. What is the 30-day...
-
????Cameron Industries is purchasing a new piece of equipment.It will cost $4 million to buy the machine and $12,000 to have itdelivered and installed. Building a clean room in the plant for 1 answer
-
Use multiplication or division of power series to find the first three nonzero terms in the Maclaurin series for each function. y = e x2 cos x
-
Forecast costs at different volumes (Learning Objectives 1, 2)} Perreth Drycleaners has capacity to clean up to 5,000 garments per month. \section*{Requirements} 1. Complete the following schedule...
-
Identify cost behavior terms (Learning Objectives 1, 2, 3, 4, 5) Complete the following statements with one of the terms listed here. You may use a term more than once, and some terms may not be used...
-
Focus on the monthly stock returns of Alcoa from 1962 to 1999. What is the average annual log return over the data span? What is the annualized (average) simple return over the data span? Consider...
Study smarter with the SolutionInn App