Write a MATLAB script check02 that prompts for user input of a vector Yin and displays...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a MATLAB script check02 that prompts for user input of a vector Yin and displays on the screen two vectors Yplus and Yminus such that Yplus and Yminus contain the positive and negative values entered in Yin, respectively. In case one of these two output vectors does not have any element (that is empty), it will show an empty matrix. Test your code with: (a) [18, -5, 89, -7, 4, 10, 12, 34, -2, 45]; (b) [34, 67, 89, 0, 12, 87, 0, 5]; Note: initialize vectors Yplus and Yminus as 0-by-0 empty matrices using: >> Yplus = []; Yminus = [ ] Write a MATLAB script check02 that prompts for user input of a vector Yin and displays on the screen two vectors Yplus and Yminus such that Yplus and Yminus contain the positive and negative values entered in Yin, respectively. In case one of these two output vectors does not have any element (that is empty), it will show an empty matrix. Test your code with: (a) [18, -5, 89, -7, 4, 10, 12, 34, -2, 45]; (b) [34, 67, 89, 0, 12, 87, 0, 5]; Note: initialize vectors Yplus and Yminus as 0-by-0 empty matrices using: >> Yplus = []; Yminus = [ ]
Expert Answer:
Answer rating: 100% (QA)
Certainly Given the instructions you need to write a MATLAB script named check02 that takes a vector ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
The site http://virtualpiano.net features an online player piano. If you click on the Key Assist menu just above the piano keyboard, and then Keyboard Keys, you will see that each key is labelled...
-
QUIZ... Let D be a poset and let f : D D be a monotone function. (i) Give the definition of the least pre-fixed point, fix (f), of f. Show that fix (f) is a fixed point of f. [5 marks] (ii) Show that...
-
Consider the utility function U(x 1 , x 2 ) = x 1 x 2 with budget constraint p 1 x 1 + p 2 x 2 = c. (a) Show that the maximum of U(x 1 , x 2 ) subject to the budget constraint is equal to c 2 /(4p 1...
-
Transactions from Gravenhurst Inc.'s current year follow. Gravenhurst follows IFRS. 1. Gravenhurst Inc. thinks it should dispose of its excess land. While the carrying value is $50,000, current...
-
Water in an open dish exposed to dry air at 25oC is found to vaporize at a constant rate of 0.04 g/h-cm2. Assuming the water surface to be at the wet-bulb temperature of ll.0C, calculate the...
-
Silicon steel is widely used in: (a) Cutting tools (b) Connecting rod (c) Electrical industry (d) Chemical industry
-
Having just returned from a stimulating seminar stressing the virtues of EVA in strategic decision making, the Vice President of Corporate Development for Venture Telecommunications, Inc. asks his...
-
Use the information below to calculate the machine's depreciation expense Machines initial cost $820 Residual value. $120 The Company started to use the machine on May 1, 2020 The useful fe of the...
-
Magic Kingdom is being audited by the IRS; one of the years under audit is 2020. Donald tells you the IRS has requested that he sign forms 870 and 872 (in his capacity as the owner and CEO of Magic...
-
Describe the Indian Major Crimes Act. Explain how there came to be a boundary between tribal and federal law. Discuss the ruling in McGirt v. Oklahoma . Do you agree with the courts decision? Explain...
-
Describe the main health care providers for cardiovascular, respiratory, gastrointestinal, and urinary systems. Explain how patients can determine from which type of specialist to seek care.
-
Describe the integration strategy that XYZ Corporation should follow to merge ABC Tech into its operations successfully. What key factors should be considered in this integration process?
-
Question 1 Describe the research process to develop a business plan. Give some examples of legal, organisational and sustainability issues,and their potential business impacts you might need to...
-
QUESTION 47 Describe value analysis. What are the desirable outcomes of value analysis to the firm? To customers? QUESTION 48 What are the six types of focus? QUESTION 49 What are the five key...
-
Boo acquired 80%k of Goose's equity for K300.000 on 1 January 2008. At the date of acquisition Goose had retained earnings of K190,000. On 31 December 2008 Boo dispatched goods which cost K80,000 to...
-
Why is homeostasis defined as the "relative constancy of the internal environments? Does negative feedback or positive feedback tend to promote homeostasis?
-
Find the Laplace transform of the following signals and their region of convergence: (a) the reflection of the unit-step signal, i.e., u(t). And then use the result together with the Laplace...
-
A sinc signal x(t) = sin(0.5t)/(t)is passed through an ideal low-pass filter with a frequency response H(j) = u( + 0.5) u( 0.5) (a) Find the Fourier transform X()and carefully plot it. (b) Find the...
-
Rectifying a sinusoid provides a way to create a dc source. In this problem we consider the Fourier series of the full and the half-wave rectified signals. The full-wave rectified signal x f (t) has...
-
(a) Distinguish between capital and revenue expenditure. (b) Drake Ltd took delivery of a computer network on 1 July 2016, the beginning of its financial year. The list price of the equipment was...
-
A business started trading on 1 January 2014. During the two years ended 31 December 2014 and 2015 the following debts were written off to the Bad Debts Account on the dates stated: On 31 December...
-
A business had always made an allowance for doubtful debts at the rate of 3 per cent of accounts receivable. On 1 January 2015 the amount for this, brought forward from the previous year, was 400....
Study smarter with the SolutionInn App