Cody

Problem 1813. 06 - Matrix Equations 1

Solution 311854

Submitted on 28 Aug 2013 by Jacob
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   Pass
%% aVec = [3.14 15 9 26]; bVec = [2.71;8;28;182]; aMat = ones(9,9)*2; ref = (aVec*bVec)*aMat^2; user = MyFunc(); assert(isequal(user,ref))

aVec = 3.1400 15.0000 9.0000 26.0000 bVec1 = 2.7100 8.0000 28.0000 182.0000 bVec = 2.7100 8.0000 28.0000 182.0000 o = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 aMat = 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 xMat = 1.0e+05 * 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405

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

aVec = 3.1400 15.0000 9.0000 26.0000 bVec1 = 2.7100 8.0000 28.0000 182.0000 bVec = 2.7100 8.0000 28.0000 182.0000 o = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 aMat = 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 xMat = 1.0e+05 * 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405

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

aVec = 3.1400 15.0000 9.0000 26.0000 bVec1 = 2.7100 8.0000 28.0000 182.0000 bVec = 2.7100 8.0000 28.0000 182.0000 o = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 aMat = 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 xMat = 1.0e+05 * 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405

4   Pass
%% aRef = ones(9,9)*2; [xMat aVec bVec aMat] = MyFunc(); assert(isequal(aRef,aMat))

aVec = 3.1400 15.0000 9.0000 26.0000 bVec1 = 2.7100 8.0000 28.0000 182.0000 bVec = 2.7100 8.0000 28.0000 182.0000 o = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 aMat = 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 xMat = 1.0e+05 * 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405 1.8405

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!