Cody

Problem 44421. Portfolio diversification: choose your stocks !

Solution 2931205

Submitted on 10 Sep 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
stock1=[0.1 0.3 0.22 -.15 ] ; stock2=[0.3 0.4 -0.13 -0.22 ]; stock3=[0.6 -0.3 0.44 0.05]; y_correct ={'stock2' 'stock3'} assert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))

Error in solution: Line: 1 Column: 44 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

2   Fail
stock1=[-0.1 0.4 -0.14 -.32 ]; stock2=[0.35 -0.10 0.66 0.18 ]; stock3=[0.62 -0.3 0.44 0.05]; y_correct = {'stock1' 'stock2'} assert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))

Error in solution: Line: 1 Column: 44 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

3   Fail
stock1=[0.3 0.4 -0.8 0.5 ]; stock2=[0.62 0.2 -0.3 0.05]; stock3=[0.35 -0.10 0.66 0.18 ]; y_correct = {'stock1' 'stock3'} assert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))

Error in solution: Line: 1 Column: 44 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

4   Fail
stock1=[-0.5 -0.2 0.35 0.02 ]; stock2=[0.2 0.15 -0.3 0.13]; stock3=[0.45 -0.04 0.66 0.2 ]; y_correct = {'stock1' 'stock2'} assert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))

Error in solution: Line: 1 Column: 44 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

5   Fail
stock1=[0.5 0.2 0.35 0.4 ]; stock2=[-0.2 -0.15 -0.3 0.13]; stock3=[-0.45 -0.04 0.33 0.15 ]; y_correct = {'stock1' 'stock3'} assert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))

Error in solution: Line: 1 Column: 44 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

6   Fail
stock1=[-0.32 -0.2 0.35 -0.4 ]; stock2=[0.2 0.15 0.3 0.13]; stock3=[-0.45 -0.04 -0.33 0.15 ]; y_correct = {'stock2' 'stock3'} assert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))

Error in solution: Line: 1 Column: 44 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

Suggested Problems

More from this Author12

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!