Cody

# Problem 1132. Create a recurrence matrix for a vector of data

Solution 182324

Submitted on 28 Dec 2012
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
%% 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)));

```Error: Second input VAL must be a vector with one element for each row in SUBS, or a scalar. ```

2   Fail
%% 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)));

```Error: Second input VAL must be a vector with one element for each row in SUBS, or a scalar. ```

3   Fail
%% 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)));

```Error: Second input VAL must be a vector with one element for each row in SUBS, or a scalar. ```