a. b. Implement a function that shifts a given vector to the right by k. For...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
a. b. Implement a function that shifts a given vector to the right by k. For example, for the vector [1, 2, 3, 4] the result for k=1 would be [4, 1, 2, 3] and for k=2 would be [3, 4, 1, 2] (every element shifts to the right k times, if the right boundary is reached the elements go to the left side of the vector). The function (or script) should take a vector and a value of k and return the shifted vector. In your solution, you may not apply the built-in function circshift that shifts arrays in MATLAB, but you can debug your code using that function. You own a computer store that sells laptops of various brands. You are considering giving a 10% discount on the current prices. However, you are worried that if you give the discount you will lose in terms of revenue. You asked a forecasting firm to predict the next month's sales (in quantity) with and without the discount. Using the data below, compute the revenues with and without discount, and decide if you will proceed with the discount. You must use vector and/or matrix operations in the solution. The script should print the revenue before & after and print a Boolean true (1) or false (0) for whether you will give discount or not that will be computed for the specific input. You may solve for the specific example below. Here is the data you need for the analysis: Prices: Brand P&H CAM LLED Microhard Forecasted quantities: Brand P&H CAM LLED Microhard Price Before Discount 1000 1200 1100 1400 Quantities before Discount 50 100 120 30 Quantities after Discount 51 105 122 35 a. b. Implement a function that shifts a given vector to the right by k. For example, for the vector [1, 2, 3, 4] the result for k=1 would be [4, 1, 2, 3] and for k=2 would be [3, 4, 1, 2] (every element shifts to the right k times, if the right boundary is reached the elements go to the left side of the vector). The function (or script) should take a vector and a value of k and return the shifted vector. In your solution, you may not apply the built-in function circshift that shifts arrays in MATLAB, but you can debug your code using that function. You own a computer store that sells laptops of various brands. You are considering giving a 10% discount on the current prices. However, you are worried that if you give the discount you will lose in terms of revenue. You asked a forecasting firm to predict the next month's sales (in quantity) with and without the discount. Using the data below, compute the revenues with and without discount, and decide if you will proceed with the discount. You must use vector and/or matrix operations in the solution. The script should print the revenue before & after and print a Boolean true (1) or false (0) for whether you will give discount or not that will be computed for the specific input. You may solve for the specific example below. Here is the data you need for the analysis: Prices: Brand P&H CAM LLED Microhard Forecasted quantities: Brand P&H CAM LLED Microhard Price Before Discount 1000 1200 1100 1400 Quantities before Discount 50 100 120 30 Quantities after Discount 51 105 122 35
Expert Answer:
Answer rating: 100% (QA)
Explanation The above code is a MATLAB function that shifts a given vector to the right by k positions The function takes two inputs the vector and th... View the full 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 databases questions
-
Current Attempt in Progress Splish Company purchased equipment for $343,000 on October 1, 2025. It is estimated that the equipment will have a useful life of 8 years and a salvage value of $63,000....
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
Think about someone you know who is an entrepreneur. What are the advantages of owning their own business? What are the disadvantages? Why did they start their business? What method did they use to...
-
Jack Lawler, a financial analyst, wants to prepare an article on the Shadow Stock portfolio developed by the American Association of Individual Investors (AAII). A list of the 30 companies in the...
-
Question 1 (2 points) Of 1600 students at Brown High School, 900 attended the first school dance of the year. Only 500 attended the next dance, and 300 attended both dances. A student is randomly...
-
A well-known poem about accounting was written by H.S. Bailey, Jr. and published in 1975 in Publishers Weekly: Discuss the message that Mr. Bailey was trying to convey through this poem. Though my...
-
Your company currently has $1000 par, 6% coupon bonds with ten years to maturity and a price of $1078. If you want to issue new ten-year coupon bonds at par, what coupon rate do you need to set?...
-
plesse help, how to make a legal applied business plan for a spa
-
On January 1, 2023, Piper Company acquired an 80% interest in Sand Company for $2,276,000. At that time the capital stock and retained earnings of Sand Company were $1,800,000 and $700,000,...
-
A distillation column, as shown in the figure to the right, is a device used to separate components with different volatilities. In a specific process, a distillation column is used to separate a...
-
Imagine that you are planning to research the positive and negative effects of social media on adolescents, and recall reading about the study referenced in this article, but don't know where to find...
-
What are the two main components or types of organizational justice? (maximum 4 word answer, no definitions required) The Black Book scenario has several examples where employees may have a...
-
1)You invest $200,000 today at a rate of 5.6%. You take $1,500 a month out of your account. How much will you have in your account in 10 years? Please go through calculations in depth.
-
In a region grappling with a burgeoning housing crisis, South Florida's local government faces a pressing challenge: How can it best support its residents in securing affordable housing? Some argue...
-
You buy a principal STRIP maturing in 7 years. The promised yield to maturity on the STRIP is 6.17%? What is the price quote as a % of par for the STRIP?
-
In the writing assignment-Amethyst Realm and having a baby with her ghost fianc, what is the problem with her usage of the terms and where precisely is she going wrong?
-
Multiple Choice Questions: 1. The largest component of aggregate demand is? a. Government purchases. b. Net exports. c. Consumption. d. Investment. 2. A reduction in personal income taxes, other...
-
Greg died on July 1, 2012, and left Lea, his wife, a $50,000 life insurance policy which she elects to receive at $5,000 per year plus interest for 10 years. In the current year, Lea receives $6,200....
-
Please answer the following questions regarding the taxability of Social Security: a. A 68-year-old taxpayer has $20,000 in Social Security income and $100,000 in tax-free municipal bond income. Does...
-
Bea Jones (age 32) moved from Texas to Florida in December 2011. She lives at 654 Ocean Way, Gulfport, FL 33707. Bea's Social Security number is 466-78-7359 and she is single. Her earnings and income...
-
Cherie and Tonys trial balance as at 31 December 2012 is set out below. 1. Closing inventory is 12,000. 2. 197 of the other expenses was prepaid and 200 is owed for the telephone. 3. Salaries will be...
-
Sister and Sledge are trading in partnership, sharing profits and losses in the ratio of 2:1, respectively. The partners are entitled to salaries of Sister 6,000 per annum and Sledge 5,000 per annum....
-
Red Devils Ltd has the following extracts from its accounts. 1. An audit fee is to be provided of 7,500. 2. The debenture interest for the year has not been paid. 3. The directors propose to transfer...
Study smarter with the SolutionInn App