Cody

Solution 1640587

Submitted on 9 Oct 2018 by Riccardo Dessì
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
a = 1; b = 2; alpha = 135; y_correct = 0.0505; F = view_factor3(a,b,alpha); assert(F < (y_correct + 1e-4)) assert(F > (y_correct - 1e-4))

ans = 0.0505

2   Pass
a = 4; b = 1; alpha = [45 90 135 180]; y_correct = [0.8160 0.4384 0.1200 0]; F = view_factor3(a,b,alpha); for i = 1:numel(y_correct) assert(F(i) < (y_correct(i) + 1e-4)) assert(F(i) > (y_correct(i) - 1e-4)) end

ans = 0.8160 0.4384 0.1200 0

3   Pass
a = [1 2 5 10 1 2 5 10]; b = [2 5 2 5 2 5 2 5]; alpha = [60 60 60 60 120 120 120 120]; y_correct = [0.3170 0.2641 0.6603 0.6340 0.0886 0.0755 0.1888 0.1771]; F = view_factor3(a,b,alpha); for i = 1:numel(y_correct) assert(F(i) < (y_correct(i) + 1e-4)) assert(F(i) > (y_correct(i) - 1e-4)) end

ans = 0.3170 0.2641 0.6603 0.6340 0.0886 0.0755 0.1888 0.1771

Suggested Problems

More from this Author139