Cody

Solution 1626002

Submitted on 12 Sep 2018 by Suraj Gurav
  • Size: 12
  • 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
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))

F = 0.0505 ans = []

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

F = 0.8160 0.4384 0.1200 0 ans = []

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

F = 0.3170 0.2641 0.6603 0.6340 0.0886 0.0755 0.1888 0.1771 ans = []

Suggested Problems

More from this Author161