Answered step by step
Verified Expert Solution
Question
1 Approved Answer
RQ 1 5 - 1 6 following questions. Each should be answered with a single MATLAB statement if possible. ( a ) Place the abbreviation
RQ
following questions. Each should be answered with a single MATLAB statement if possible.
a Place the abbreviation of the stock with the highest current price in CurrentHigh.
b Place the abbreviation of the stock with the lowest purchase price in Cheapest.
c Create a single row Melement cell array named Best containing the abbreviations of all stocks that have increased in value by more than
Number of shares.
e Place the total profit that would be made by selling all of the shares from the preceding question into the variable TotalProfits.
Script
Variables to be used
Inputs
Stocks cell array containing
top element cell array containing single row of stock abbreviations character arrays
bottom element matrix matrix of purchase price row current price row and number of stocks row
outputs
CurrentHigh character array of stock with the highest current price
Cheapest character array of stock with the lowest purchase price
Best cell array containing character array of stocks which have increased by in value
Profits cell array containing
element singlerow cell array of stocks found in Best
element singlerow vector contain profit from selling each stock in Best
Totalprofits scalar containing total profit from selling all stocks in Best
Inputs
GenerateStocks This script generates the cell array Stocks.
Program
Write your program here
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started