Problem 8045. Gold Standard

Gold has long been used as currency and a standard for currency, due to its inherent value and rarity. Historical data for gold is available at Measuring Worth.

For this problem, you will be provided with a historical year (HY) and a historical value (HV) in dollars. The function template includes data from the previously mentioned site for the value (in dollars) of an ounce of gold (GV) from 1791 to 2014. Write a function to determine the current value (CV) in dollars assuming that the gold standard can be accurately used to convert between years. Round the result to two decimal places. If HY is outside of the historical-data range, return NaN.

As an example, with HY = 2000 and HV = 1000:

  • GV(HY=2000) = $280.10
  • N = 1000/280.10 = 3.57 (ounces of gold)
  • CV = 3.57*1270 (current $/ounce of gold) = $4534.09.

Solution Stats

45.68% Correct | 54.32% Incorrect
Last Solution submitted on Nov 13, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers53

Suggested Problems

More from this Author139

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!