Cody

Solution 1694404

Submitted on 17 Dec 2018 by James
  • Size: 14
  • 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
u=[2 3]; v=4; y_correct = [2 4; 4 3]; assert(isequal(tri_diag(u,v),y_correct))

2   Pass
u=[2 3 6]; v=[4 -1]; y_correct = [2 4 0; 4 3 -1 ; 0 -1 6]; assert(isequal(tri_diag(u,v),y_correct))

3   Pass
u=[2 3 6 8]; v=[4 -1 1]; y_correct = [2 4 0 0; 4 3 -1 0 ; 0 -1 6 1; 0 0 1 8]; assert(isequal(tri_diag(u,v),y_correct))

Suggested Problems

More from this Author2