Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Trying to pull exchange rates from a url in MATLAB, but I can't find any websites that have a table that is suitable. Please if

Trying to pull exchange rates from a url in MATLAB, but I can't find any websites that have a table that is suitable. Please if someone could find one and provide the syntax necessary to fix this.
image text in transcribed
image text in transcribed
image text in transcribed
USDAmount = app. AmountEditField.Value; selectedCurrency = app. CountryDropDown.Value; exchangeRate = getExchangeRate (selectedCurrency); convertedAmount = USDAmount * exchangeRate; function rate = getExchangeRate (currency) switch currency case 'EUR' rate =0.91795 case 'GBP' rate =0.78917; case 'INR' rate =83.0166; case 'AUD' rate =1.49196; case 'CAD' rate =1.33729; case 'SGD' rate =1.33327; case ' MYR ' rate =4.67098; case 'CHF'. rate =0.87099; case 'JPY' rate =142.2913; case ' C Tr' rate =7.11049; otherwise rate =1.0; end end url = 'https://example.com'; htmlcontent = webread ( url ); currencyPattern = '> span class = "currency-value" (. ? ) sparp'; currencyMatches =regexp(htm1 Content, currencyPattern, 'tokens ' ); usdValue =str2 double ( currencyMatches {1}{1}); eurValue =str2 double (currencyMatches {2}{1}); Currency Converter USD (United States Dollar) Amount

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

More Books

Students also viewed these Databases questions