MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

# Solution 185868

Submitted on 4 Jan 2013 by Joseph Kirk

Correct

172Size
`This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.`

### Test Suite

Test
Code Input and Output
1
Pass

```%%
A = [
0 1 1 0
1 1 0 1
1 0 0 1
1 1 0 0];
nCycles = 7;
assert(isequal(count_directed_cycles(A),nCycles))
```

2
Pass

```%%
A = [
0 1 0 1 0 1 0 0
0 0 0 1 1 0 1 1
1 1 0 1 1 0 1 1
0 1 0 0 1 0 1 0
1 1 0 0 1 0 1 0
1 0 0 0 0 0 1 0
1 1 1 1 0 0 0 1
0 0 0 1 1 1 1 1];
nCycles = 197;
assert(isequal(count_directed_cycles(A),nCycles))
```

3
Pass

```%%
A = [
1 0 1 0 0 1 1 0 1 1
1 0 1 0 1 1 1 1 1 1
0 0 1 0 0 1 1 1 1 1
0 1 0 0 0 0 0 0 1 1
0 0 1 0 1 0 1 1 1 0
1 1 1 0 0 0 0 1 0 0
0 0 0 1 0 1 1 0 1 0
1 0 1 1 0 0 0 0 1 0
1 0 0 0 0 0 1 0 0 1
1 0 0 0 0 0 0 0 1 0];
nCycles = 744;
assert(isequal(count_directed_cycles(A),nCycles))
```

4
Pass

```%%
A = [
0 0 0 0 1 0 1 1 1 1
0 0 0 1 0 1 0 1 1 1
0 0 0 0 0 0 1 1 1 1
0 0 1 0 1 1 0 1 0 0
0 1 0 1 0 0 0 0 0 1
1 0 0 1 1 1 1 0 1 1
0 1 1 1 1 0 1 1 0 1
0 1 0 0 1 1 0 0 0 1
1 0 1 0 0 1 1 0 1 1
1 0 1 1 0 1 1 0 0 0];
nCycles = 4961;
assert(isequal(count_directed_cycles(A),nCycles))
```