Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with coding problem 3 in matlab. They other paper is some instructions to how code it. Thanks Problem #3 Background: You are

I need help with coding problem 3 in matlab. They other paper is some instructions to how code it. Thanks image text in transcribed
image text in transcribed
Problem #3 Background: You are provided a 2xl cell array named Stocks. The first element holds a cell array that contains a row vector of N-number text strings; these text strings are abbreviations of various stocks on the New York Stock Exchange. The second element ofStocks holds a 3xN matrix which contains information regarding each respective stock (Note: the row vector in the first element of Stocks contains the same number of columns (N) as the matrix in the second element of Stocks). The first row of this matrix contains the initial purchase price of any given stock; the second row of this matrix contains the current purchase price of any given stock; the third row of this matrix contains the number of shares of any given stock. Using this information, create a code that computes the following steps I. 2. 3. 4. 5. Locate the stock with the highest initial purchase price and place its name (abbreviation) within a new variable named PurchaseHigh, which should also store the initial purchase price value. Locate the stock with the highest current purchase price and place its name (abbreviation) within a new variable named CurrentHigh, which should also store the current price value of the stock. Create a single row variable named BestID containing the names of all stocks that have increased in value (from initial purchase price to current purchase price) by more than 30% Create a single row variable named BestPercent that contains the exact percentage increases of each stock found in BestID-for obvious reasons, none of these percentages should be below 30%. Create a single row variable named Profit that contains the profit to be made if one were to sell each of the stocks found in BestID immediately (use the equation (CurrentPurchasePrice 6. Create a 2xN matrix named Rank. In this variable, rank the stocks by both initial purchase price (in the first row) and current purchase price (in the second row). The stocks stored in CurrentHigh and PurchaseHigh should be ranked #1 in their respective categories, and the least valued stocks should be rank #N. In a formatted output statement, output to the command window the information stored in CurrentHigh and PurchaseHigh. Also, using the information stored in Rank, find a way to provide a progress report on these two stocks-you know, that PurchaseHigh is rank #1 for the initial purchase price category, so inform the user as to its rank in terms of its current purchase price (and the reverse for the stock stored in CurrentHigh). See the example given below for formatting 7. 8. In a formatted output statement, output to the command window the stock that experienced the greatest value increase: include the name of the stock, both of its purchase prices, and its percentage increase. mand Wi Steek yD had the h2gh.st purchss. pr10. 8t S50.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions

Question

3. Existing organizations and programs constrain behavior.

Answered: 1 week ago