Cody

Problem 1814. 06 - Matrix Equations 2

Solution 3470918

Submitted on 29 Oct 2020 at 16:27
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
aVec = [3.14 15 9 26]; bVec = [2.71;8;28;182]; ref = bVec*aVec; user = MyFunc(); assert(isequal(user,ref))

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in MyFunc (line 4) yMat = bVec*aVec; Error in Test1 (line 4) user = MyFunc();

2   Fail
aRef = [3.14 15 9 26]; [xMat aVec] = MyFunc(); assert(isequal(aRef,aVec))

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in MyFunc (line 4) yMat = bVec*aVec; Error in Test2 (line 2) [xMat aVec] = MyFunc();

3   Fail
bRef = [2.71;8;28;182]; [xMat aVec bVec] = MyFunc(); assert(isequal(bRef,bVec))

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in MyFunc (line 4) yMat = bVec*aVec; Error in Test3 (line 2) [xMat aVec bVec] = MyFunc();

Suggested Problems

More from this Author26

Community Treasure Hunt

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

Start Hunting!