Cody

Solution 2115033

Submitted on 2 Feb 2020 by Asif Newaz
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))

y = 2 0 0 3 z1 = 0 0 4 0 z2 = 0 4 0 0

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))

y = 2 0 0 0 3 0 0 0 6 z1 = 0 0 0 4 0 0 0 -1 0 z2 = 0 4 0 0 0 -1 0 0 0

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))

y = 2 0 0 0 0 3 0 0 0 0 6 0 0 0 0 8 z1 = 0 0 0 0 4 0 0 0 0 -1 0 0 0 0 1 0 z2 = 0 4 0 0 0 0 -1 0 0 0 0 1 0 0 0 0

Suggested Problems

More from this Author2