Cody

Solution 1866270

Submitted on 5 Jul 2019
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
x = 40; y_correct = [34.86 19.61]; [y1 y2]=TV(x) assert(y1-y_correct(1)<=0.01 && y2-y_correct(2)<=0.01)

Index exceeds the number of array elements (2). Error in TV (line 2) [width height] = subsref(num2cell([9 16]*d/sqrt(9^2+16^2)), struct('type',{'{}'},'subs',{{1:4}}) ); Error in Test1 (line 3) [y1 y2]=TV(x)

2   Fail
x=49 y_correct = [42.71 24.02]; [y1 y2]=TV(x) assert(y1-y_correct(1)<=0.01 && y2-y_correct(2)<=0.01)

x = 49

Index exceeds the number of array elements (2). Error in TV (line 2) [width height] = subsref(num2cell([9 16]*d/sqrt(9^2+16^2)), struct('type',{'{}'},'subs',{{1:4}}) ); Error in Test2 (line 3) [y1 y2]=TV(x)