Cody

Solution 507033

Submitted on 1 Oct 2014
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
%% AB = [ -10 10 ; -10 10 ]; F{1} = [ -5 5 -8 0 -6 2 7 1 ]; F{2} = [ 4 -2 4 6 6 -7 -3 -2 ]; F{3} = [ -5 6 3 -1 -6 -8 4 -2 ]; f = WayfindingPassed(AB,F); f_correct = [ 1 3 2 ]; assert(isequal(f,f_correct));

[Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] ans = 1 3 2 1 3 2 j = 1 4 j = 3 6 j = 2 5

2   Pass
%% AB = [ 0 21 ; 0 0 ]; f_correct = randperm(20); F = arrayfun(@(n)[n+[0 1 1 0];-1 -1 1 1],f_correct,'uni',0); f = WayfindingPassed(AB,F); assert(isequal(f(f_correct),f_correct(f)));

[Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB...

3   Pass
%% AB = [ -10 10 ; -10 10 ]; F{1} = [ -5 9 0 -4 5 2 8 -1 -9 -8 ]; F{2} = [ -2 -10 -4 0 8 7 -5 5 ]; F{3} = [ -6 2 10 10 -4 8 ]; F{4} = [ -10 8 -10 4 -8 2 ]; F{5} = [ 0 4 8 -3 1 -10 9 -8 -5 2 ]; F{6} = [ 6 6 -9 10 6 -3 4 -7 ]; F{7} = [ 9 7 -7 0 7 -5 ]; F{8} = [ 2 0 10 6 -10 0 ]; F{9} = [ -7 2 -7 -7 3 5 -3 7 ]; F{10} = [ -5 6 1 5 -10 0 8 4 ]; f = WayfindingPassed(AB,F); f_correct = [ 2 7 8 10 7 3 ]; assert(isequal(f,f_correct));

[Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] ans = Columns 1 through 16 2 7 2 4 4 1 6 5 3 6 5 8 5 10 8 10 Columns 17 through 23 5 6 6 7 7 1 3 j = 6 22 j = 1 3 j = 9 23 j = 4 5 j = 8 11 13 17 j = 7 10 18 19 j = 2 20 21 j = 12 15 j = Empty matrix: 1-by-0 j = 14 16

4   Pass
%% AB = [ -10 10 ; -10 10 ]; F{1} = [ 2 5 8 5 2 -2 9 -5 ]; F{2} = [ -8 2 -2 8 -8 -2 0 4 5 -9 8 -2 ]; F{3} = [ 5 -6 -2 1 0 10 10 -8 0 10 -2 -5 ]; F{4} = [ 10 -4 -10 -2 9 4 1 8 -4 -1 ]; F{5} = [ -9 -7 2 -3 2 -9 -4 5 ]; F{6} = [ -3 10 6 9 4 -2 10 -6 2 2 5 -5 ]; F{7} = [ -1 -5 -5 3 0 -4 ]; F{8} = [ 8 -6 8 10 -7 8 -2 -5 3 7 ]; F{9} = [ 1 -10 -3 10 5 -5 -6 3 -6 8 ]; F{10} = [ -7 0 8 -8 7 -8 3 9 ]; f = WayfindingPassed(AB,F); f_correct = [ 5 9 10 9 3 1 8 ]; assert(isequal(f,f_correct));

ans = Columns 1 through 16 5 9 3 3 4 8 10 6 2 2 2 5 3 9 2 1 Columns 17 through 30 1 4 6 6 9 8 10 6 9 3 1 1 8 8 j = 16 17 27 28 j = 9 10 11 15 j = 3 4 13 26 j = 5 18 j = 1 12 j = 8 19 20 24 j = Empty matrix: 1-by-0 j = 6 22 29 30 j = 2 14 21 25 j = 7 23

5   Pass
%% AB = [ 4 -6 ; 0 0 ]; F{1} = [ -4 -4 2 2 -2 -3 -3 -2 2 2 -4 2 -4 -4 -2 2 2 -2 -2 2 4 4 ]; f = WayfindingPassed(AB,F); f_correct = [ 1 ]; assert(isequal(f,f_correct));

[Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] ans = 1 1 1 1 j = 1 2 3 4

6   Fail
%% AB = [ 0 0 ; 15 -8 ]; F{1} = [ -4 4 4 -4 6 2 6 2 ]; F{2} = [ -2 -2 6 6 -2 -0 -4 -0 -4 -0 ]; F{3} = [ -1 -1 2 2 -6 -4 -6 -4 ]; F{4} = [ -1 1 -1 1 -7 -7 -9 -9 ]; F{5} = [ -2 2 -1 2 -1 1 14 10 6 6 10 14 ]; f = WayfindingPassed(AB,F); f_correct = [ 5 5 1 2 3 4 ]; assert(isequal(f,f_correct));

Error: Assertion failed.

7   Fail
%% AB = [ 0 0 ; -6 6 ]; F{1} = [ -5 7 7 -5 -9 -9 9 9 ]; F{2} = [ -1 1 1 -1 -7 -7 -5 -5 ]; F{3} = [ -2 -2 2 2 4 2 2 4 ]; F{4} = [ 2 2 -2 -2 4 2 2 4 ]; F{5} = [ -1 1 1 -1 2 2 -2 -2 ]; F{6} = [ -2 0 -2 -2 -3 -4 ]; F{7} = [ 0 2 2 -3 -4 -2 ]; F{8} = [ -1 0 1 -8 -6 -8 ]; f = WayfindingPassed(AB,F); f_correct = [8 2 1 7 1 5 4 1]; assert(isequal(f,f_correct));

Error: Assertion failed.

8   Pass
%% AB = [ 2 -2 ; 8 -6 ]; F{1} = [ -4 -4 4 4 -4 -0 -0 -4 ]; F{2} = [ -4 -4 4 4 2 6 6 2 ]; f = WayfindingPassed(AB,F); f_correct = [2 1]; assert(isequal(f,f_correct));

ans = 2 2 1 1 j = 3 4 j = 1 2

9   Pass
%% AB = [ 8 -4 ; 8 -8 ]; F{1} = [ -6 2 2 -4 -4 8 8 -6 -6 -6 -4 -4 2 2 4 4 ]; F{2} = [ -2 -2 4 4 -0 -2 -2 -0 ]; f = WayfindingPassed(AB,F); f_correct = [ 1 2 1 ]; assert(isequal(f,f_correct));

ans = 1 1 2 2 1 1 j = 1 2 5 6 j = 3 4

10   Fail
%% AB = [ -8 8 ; 8 -8 ]; F{1} = [ -2 -2 0 0 -0 2 2 -0 ]; F{2} = [ 2 4 4 -6 -6 -4 2 4 4 2 2 -4 -4 2 -0 -0 -6 -6 4 6 6 4 2 2 4 4 -4 -4 ]; F{3} = [ -3 -3 1 0 -1 -3 -3 -1 ]; F{4} = [ 5 9 9 5 -3 -3 -9 -9 ]; F{5} = [ -9 -10 -10 -9 9 9 10 10 ]; f = WayfindingPassed(AB,F); f_correct = [ 2 1 2 4 ]; assert(isequal(f,f_correct)); AB = [ 0 0 ; -8 8 ]; F{1} = [ -4 -2 -2 -4 8 8 4 4 ]; F{2} = [ 2 4 4 2 -0 -0 -6 -6 ]; F{3} = [ -4 -2 -2 -6 -6 -4 -4 -6 -6 -4 ]; f = WayfindingPassed(AB,F); assert(isempty(f));

Error: Assertion failed.

11   Pass
%% AB = [ 7 -8 ; 0 0 ]; F{1} = [ 8 9 9 8 3 3 -2 -2 ]; F{2} = [ -9 -7 -7 -4 -4 -3 -3 0 0 1 1 4 4 5 5 -2 -8 -9 -2 -2 2 2 -2 -2 2 2 -2 -2 2 2 -2 -2 3 4 3 2 ]; F{3} = [ -2 -1 -1 -2 1 1 -4 -4 ]; F{4} = [ -6 -5 -5 -3 1 2 2 3 3 1 -4 -6 1 1 -3 -5 -5 -4 1 1 -5 -8 -7 -4 ]; f = WayfindingPassed(AB,F); f_correct = [ 2 4 2 3 2 4 2 ]; assert(isequal(f,f_correct));

[Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] [Warning: Matrix is singular to working precision.] [> In WayfindingPassed>@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]') at 2 In WayfindingPassed>@(f)cell2mat(cellfun(@(x)[AB,x]*str2num('[-1 0;1 0; 0 1; 0 -1]')\[AB,x]*str2num('[-1;0;1;0]'),num2cell(reshape(vertcat(f,circshift(f,0:1)),2,2,''),1:2),'uni',0)) at 2 In WayfindingPassed at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] ans = 2 2 4 4 2 2 3 3 2 2 4 4 2 j = Empty matrix: 1-by-0 j = 1 2 5 6 9 10 13 j = 7 8 j = 3 4 11 12

12   Pass
%% AB = [ 0 -2 ; 0 -4 ]; F{1} = [ -3 3 3 2 2 -2 -2 2 2 -3 -5 -5 3 3 -3 -3 2 2 3 3 ]; F{2} = [ -1 1 1 -1 1 1 -1 -1 ]; F{3} = [ -4 4 4 5 5 -5 -5 -4 4 4 -7 -7 5 5 -1 -1 ]; F{4} = [ -5 -4 -4 4 4 -5 -1 -1 -6 -6 -7 -7 ]; f = WayfindingPassed(AB,F); f_correct = [ 2 1 ]; assert(isequal(f,f_correct));

ans = 2 1 j = 2 j = 1

13   Fail
%% AB = [ -2 0 ; 6 -6 ]; F{1} = [ 2 -4 -4 2 2 -2 0 -2 2 -4 -4 4 4 2 2 -0 -2 -2 ]; f = WayfindingPassed(AB,F); f_correct = [ 1 1 1 ]; assert(isequal(f,f_correct));

Error: Assertion failed.