Problem 8047. Weighted Gold/Silver Standard
Building off of the Gold Standard and Gold/Silver Standard problems, let's make a weighted currency convertor. The same data for gold value and silver-to-gold ratio will be provided in the function template.
For this problem, based on a historical year (HY) and a historical value (HV) in dollars, calculate the current value using the gold (CVG) and silver (CVS) references; see the referenced problems for details and examples of those individual problems. In this case, you will be provided a weighting that will range from 0 to 1, where 0 indicates complete weighting by gold and 1 indicates complete weighting by silver. Remember to round the result to two decimal places. If HY is outside of the historical data range, return NaN.
As an example, with HY = 2000, HV = 1000, and wt = 0.4:
- CVG = $4534.09 (gold standard)
- CVS = $3822.36 (silver standard)
- CV = (1-0.4)*4534.09 + 0.4*3822.36 = $4249.40.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers43
Suggested Problems
-
Find the alphabetic word product
3397 Solvers
-
Back to basics 23 - Triangular matrix
1083 Solvers
-
851 Solvers
-
Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
239 Solvers
-
Find the sides of an isosceles triangle when given its area and height from its base to apex
2067 Solvers
More from this Author139
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!