Cody

Problem 8046. Gold/Silver Standard

Solution 2165859

Submitted on 19 Mar 2020
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
HY = 2014; HV = 1270; CV_corr = 1270; assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

NS = 66.3800

Output argument "CV" (and maybe others) not assigned during call to "gold_silver_standard". Error in Test1 (line 2) assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

2   Pass
HY = 500; HV = 50; CV_corr = NaN; assert(isnan(gold_silver_standard(HY,HV)))

CV = NaN

3   Pass
HY = 2500; HV = 5000; CV_corr = NaN; assert(isnan(gold_silver_standard(HY,HV)))

CV = NaN

4   Fail
HY = 2010; HV = 1000; CV_corr = 945.54; assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

NS = 49.4214

Output argument "CV" (and maybe others) not assigned during call to "gold_silver_standard". Error in Test4 (line 2) assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

5   Fail
HY = 2005; HV = 1000; CV_corr = 2603.88; assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

NS = 136.0987

Output argument "CV" (and maybe others) not assigned during call to "gold_silver_standard". Error in Test5 (line 2) assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

6   Fail
HY = 2000; HV = 1000; CV_corr = 3822.36; assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

NS = 199.7858

Output argument "CV" (and maybe others) not assigned during call to "gold_silver_standard". Error in Test6 (line 2) assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

7   Fail
HY = 1995; HV = 1000; CV_corr = 3711.31; assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

NS = 193.9818

Output argument "CV" (and maybe others) not assigned during call to "gold_silver_standard". Error in Test7 (line 2) assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

8   Fail
HY = 1990; HV = 1000; CV_corr = 3965.32; assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

NS = 207.2585

Output argument "CV" (and maybe others) not assigned during call to "gold_silver_standard". Error in Test8 (line 2) assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

9   Fail
HY = 1950; HV = 1000; CV_corr = 25768.43; assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

NS = 1.3469e+03

Output argument "CV" (and maybe others) not assigned during call to "gold_silver_standard". Error in Test9 (line 2) assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

10   Fail
HY = 1900; HV = 1000; CV_corr = 30850.44; assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

NS = 1.6125e+03

Output argument "CV" (and maybe others) not assigned during call to "gold_silver_standard". Error in Test10 (line 2) assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

11   Fail
HY = 1850; HV = 1000; CV_corr = 14532.01; assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

NS = 759.5549

Output argument "CV" (and maybe others) not assigned during call to "gold_silver_standard". Error in Test11 (line 2) assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

12   Fail
HY = 1800; HV = 1000; CV_corr = 15471.58; assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

NS = 808.6643

Output argument "CV" (and maybe others) not assigned during call to "gold_silver_standard". Error in Test12 (line 2) assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

13   Fail
ind = randi(4); switch ind case 1 HY = 2000; HV = 1000; CV_corr = 3822.36; case 2 HY = 1995; HV = 1000; CV_corr = 3711.31; case 3 HY = 2005; HV = 1000; CV_corr = 2603.88; case 4 HY = 1800; HV = 1000; CV_corr = 15471.58; end assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

NS = 193.9818

Output argument "CV" (and maybe others) not assigned during call to "gold_silver_standard". Error in Test13 (line 12) assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

14   Fail
ind = randi(4); switch ind case 1 HY = 1995; HV = 1000; CV_corr = 3711.31; case 2 HY = 1990; HV = 1000; CV_corr = 3965.32; case 3 HY = 2010; HV = 1000; CV_corr = 945.54; case 4 HY = 1900; HV = 1000; CV_corr = 30850.44; end assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

NS = 1.6125e+03

Output argument "CV" (and maybe others) not assigned during call to "gold_silver_standard". Error in Test14 (line 12) assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

15   Fail
ind = randi(4); switch ind case 1 HY = 1990; HV = 1000; CV_corr = 3965.32; case 2 HY = 1950; HV = 1000; CV_corr = 25768.43; case 3 HY = 1900; HV = 1000; CV_corr = 30850.44; case 4 HY = 2000; HV = 1000; CV_corr = 3822.36; end assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)

NS = 1.3469e+03

Output argument "CV" (and maybe others) not assigned during call to "gold_silver_standard". Error in Test15 (line 12) assert(abs(gold_silver_standard(HY,HV)-CV_corr)<2e-5)