4.1 Write a function called checkmat_even_odd' that will receive a matrix (for example, mat) as an...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
4.1 Write a function called "checkmat_even_odd' that will receive a matrix (for example, mat) as an input argument, and return a new matrix (same size with the input matrix) using nested for loops. If the element in the input matrix is an even number, then the corresponding element in the new matrix is 0; otherwise, the element in the new matrix is 1. Also, write the block comment "This function check the even/odd number of a matrix." See below example: mat= 1 -2 3 -4 -5 6 -7 8 9 10 11 -12 outmat= 1 1 1 0 0 1 0 1 0 0 1 0 4.2 Generate a random 3-by-5 integer matrix called "mat" in the range [-10, 10], and test your code, for example: [outmat] = checkmat_even_odd(mat) 4.1 Write a function called "checkmat_even_odd' that will receive a matrix (for example, mat) as an input argument, and return a new matrix (same size with the input matrix) using nested for loops. If the element in the input matrix is an even number, then the corresponding element in the new matrix is 0; otherwise, the element in the new matrix is 1. Also, write the block comment "This function check the even/odd number of a matrix." See below example: mat= 1 -2 3 -4 -5 6 -7 8 9 10 11 -12 outmat= 1 1 1 0 0 1 0 1 0 0 1 0 4.2 Generate a random 3-by-5 integer matrix called "mat" in the range [-10, 10], and test your code, for example: [outmat] = checkmat_even_odd(mat)
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
answer all questions as instructed below. attend all questions. 4 Computer Vision (a) Explain why such a tiny number of 2D Gabor wavelets as shown in this sequence are so efficient at representing...
-
answer all questions as instructed below. make sure you have attended all questions .Comparative Architectures (a) Describe the organisation of a two-level branch predictor that makes use of a global...
-
Formulate a plausible mechanism for the following reaction. The product is a precursor of mediquox (shown in the margin), an agent used to treat respiratory infections in chickens (no, we are not...
-
(a) Find the critical F-value for a right-tailed test with a = 0.05, degrees of freedom in the numerator = 8, and degrees of freedom in the denominator = 9. (b) Find the critical F-value for a...
-
Suppose a ten-year, $1000 bond with an 8% coupon rate and semiannual coupons is trading for a price of $1034.74. a. What is the bonds yield to maturity (expressed as an APR with semiannual...
-
A salespersons past and present performances affect his or her expectations for future performance. After experiencing several failures, many new salespeople quit their sales job within a few months...
-
Tiffany Lamp Company produces stained glass lamps appropriate for home and office use. The company expects sales to total approximately $50 million for the current year. Tiffanys management team has...
-
Amanda Manufacturing Company prepared the following static budget income statement: Revenues $ 140,250.00 Variable Costs (85,250.00) Contribution Margin 55,000.00 Fixed Costs (32,000.00) Net Income $...
-
Sullivan Ranch Corporation has purchased a new tractor. The following information is given: $150,000 $10,000 Cost: Estimated Residual: Estimated Life in years: Estimated Life in hours: Actual Hours:...
-
Read the case carefully and answer questions that follows. No shortage of teachers assures Education Ministry Praneeta Prakash OCTOBER 13, 2021 4:40 PM The Ministry of Education has assured all that...
-
CC301 Tax Law T122 / My courses/ ACC301_0122 / General / T122 Practice Workbook Assessment Question 1 Not complete Marked out of 2 Flag question On 1 July 2019 Melissa acquired an antique Camel...
-
In large firms, financial activity is usually associated with ? Explain why.
-
Should students be monitored when taking online test? Yes or no, why or why not?
-
What types of donations are charitable gifts for income tax purposes in Canada?
-
Income taxes on businesses accounted for $212 billion, or about 6% of total tax receipts. Payroll and individual income taxes comprised the vast majority of collected funds. Considering that...
-
A=2ax-5ay+3az, B=3ax-4ay and C=ax+ay+az Determine a. A-2B b. |A-5c| c. value of k |kB|=2? d. |AB|/A.B
-
D Which of the following is considered part of the Controlling activity of managerial accounting? O Choosing to purchase raw materials from one supplier versus another O Choosing the allocation base...
-
Sally and Charles Heck received the following dividends and interest during 2012: Assuming the Hecks file a joint tax return, complete Schedule B of Form 1040 (on page 2-33) for them for the 2012 tax...
-
How much of each of the following prizes or awards is taxable? a. Cheline received a $50,000 gift bag at the Oscars in 2012. b. Jon received a gold watch worth $350 for 25 years of service to his...
-
Indicate whether each of the items listed below would be included (I) in or excluded (E) from gross income for the 2012 tax year. ________a. Welfare payments ________b. Commissions ________c. Hobby...
-
What is an overnight reverse repurchase agreement (ON RRP)? What role does the interest on ON RRP play in the way the Fed hits its target for the federal funds rate in the current ample-reserves...
-
During a panel discussion, Randal Quarles, who was then a member of the Feds Board of Governors observed: The point about QE when we reach the zero lower bound is its a game changer. a. What is QE?...
-
In 2022, as the inflation rate in the United States was rapidly increasing, an editorial in the Wall Street Journal argued: In practice, forward guidance has tied the Fed to loose policies when...
Study smarter with the SolutionInn App