Cody

Solution 180926

Submitted on 22 Dec 2012 by Khaled Hamed
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
%% v = [4 2 3 1 1 3 4 5 1 3]; real_r = [1 0 2 0 0; 0 0 1 0 0; 1 0 0 1 0; 0 1 0 0 1; 1 0 0 0 0]; real_u = 1:5; [r,u] = recurrence(v); assert(and(isequal(r,real_r), isequal(u,real_u)));
2   Pass
%% v = [1:6,1]; real_r = circshift(eye(6),[0 1]); real_u = 1:6; [r,u] = recurrence(v); assert(and(isequal(r,real_r), isequal(u,real_u)));
3   Pass
%% v = [0 0 0 0 0 0]; real_r = 5; real_u = 0; [r,u] = recurrence(v); assert(and(isequal(r,real_r), isequal(u,real_u)));