Cody

Solution 1011783

Submitted on 12 Oct 2016 by Cseppento Bence
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
x1 = [11 10 2]; x2 = [4 4 3]; y_correct = zeros(3,3,3); y_correct(:,:,1) = [44 44 33; 40 40 30; 8 8 6]; y_correct(:,:,2) = [704 704 297; 640 640 270; 128 128 54]; y_correct(:,:,3) = [96.8 96.8 72.6; 80 80 60; 3.2 3.2 2.4]; assert(sum(sum(sum(abs(your_fcn_name(x1,x2)-y_correct))))<1e-3)

2   Pass
x1 = [1 2 3]; x2 = [1 5 9]; y_correct = zeros(3,3,3); y_correct(:,:,1) = [1 5 9; 2 10 18; 3 15 27]; y_correct(:,:,2) = [1 125 729; 2 250 1458; 3 375 2187]; y_correct(:,:,3) = [0.2 1.0 1.8; 0.8 4.0 7.2; 1.8 9.0 16.2]; assert(sum(sum(sum(abs(your_fcn_name(x1,x2)-y_correct))))<1e-3)

3   Pass
x1 = [-4 7 9]; x2 = [3 2 11]; y_correct = zeros(3,3,3); y_correct(:,:,1) = [-12 -8 -44; 21 14 77; 27 18 99]; y_correct(:,:,2) = [-108 -32 -5324; 189 56 9317; 243 72 11979]; y_correct(:,:,3) = [9.6 6.4 35.2; 29.4 19.6 107.8; 48.6 32.4 178.2]; assert(sum(sum(sum(abs(your_fcn_name(x1,x2)-y_correct))))<1e-3)

Suggested Problems

More from this Author27