Cody

Solution 1116954

Submitted on 7 Feb 2017 by Kari Roth
  • Size: 89
  • This is the leading solution.
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
C = {'a=1;' 'b=1;' 'c=a+b;' 'c=c+1;'}; mat = [0 0 1 1; 0 0 1 1; 0 0 0 1; 0 0 0 0]; assert(isequal(pGraph(C),mat))

2   Pass
C = {'a=1;' 'a=1;' 'c=1;' 'c=1;'}; mat = [0 0 0 0; 0 0 0 0; 0 0 0 0; 0 0 0 0]; assert(isequal(pGraph(C),mat))

3   Pass
C = {'a=1;' 'a=1;' 'c=a+1;' 'c=a+1;'}; mat = [0 0 0 0; 0 0 1 1; 0 0 0 0; 0 0 0 0]; assert(isequal(pGraph(C),mat))

4   Pass
C = {'a=1;' 'b=a+2;' 'c=b+1;' 'd=c+1;'}; mat = double(~tril(ones(4))) assert(isequal(pGraph(C),mat))

mat = 0 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0