Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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 of Stocks 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 Locate the stock with the highest current 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 initial 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) Create a single row variable named BestPercent that contains the exact percentage increases of each stock found BestID (use the equation (CurrentPurchasePrice - InitialPurchasePrice)*NumberOfShares) 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 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. 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 of Stocks 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 Locate the stock with the highest current 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 initial 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) Create a single row variable named BestPercent that contains the exact percentage increases of each stock found BestID (use the equation (CurrentPurchasePrice - InitialPurchasePrice)*NumberOfShares) 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 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

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

Students also viewed these Databases questions

Question

A service window closes just as they get to the front of the line.

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago