mathlab
They say all is fair in love and chorizo, though it's posible only I say it. The powerhouse brands San Manuel, Cacique and San Luis have developed marketing strategies to try and retake portions of the market share held by their competitors. If the strategies are successful then per month: San Manuel will capture 10% of Cacique's share, and 20% of San Luis's share San Luis will capture 10% of San Manuel's share, and 30% of Cacique's share . Cacique will capture 10% of San Manuel's share and 10% of San Manuel's share. The graph below models the flow of market shares between the companies 20% -10% SA . > t del this market flow by having the vector x represent San Manuel's market share after k months X San Luis's market share after k months | Cacique's market share after k months 0.8 0.2 0.11 then xel Axe where A 10.1 0.7 0.3 0.1 0.1 0.6 Write a Matlab function titled market share.n that implements the pseudocode on the following page, accepting an initial market share vector X, and a positive integer in input and outputs the market share at the month, as well as a plot. The first line of your code should therefore be function [x] - market share(x0,n) 2. Write a script titled hv2.m that runs market share.n three times, to simulate over a 2 year period, the chorizo market fluctuations when the initial market share is! [1/3] [0.45] To = 1/3 0.35 . and I = [1/3] L 0.2 where r is a randomly generated 3 x 1 vector drawn uniformly from the interval (0,1) (use the rand function to generate r. Note that the 1-norm of a vectory in matlab is computed norm(y, 1)). Report the final market share for each of the 3 experiments and submit the generated plots for each simulation as well. Market Share Pseudocode INPUT ro, an initial, n, positive OUTPUT X, [0.8 0.2 0.1] A-10.1 0.7 0.3 0.1 0.1 0.6|| for k=1.....n-1 X4+1 = Ax end for loop All in the same figure: (Note: here X is the matrix whose the column is X ) Plot the array 1 2 3 ... n) (on -axis) versus the first row of X using a dot-dash plot, with pixel size 30 and linewidth 3. Plot the array [1 2 3 n (on t-axis) versus the second row of X using a dot-dash plot, with pixel size 30 and linewidth 3. Plot the array 1 23 n (on-axis) versus the third row of X using a dot-dash plot, with pixel size 30 and linewidth 3. Add a legend to the plot